ssltls1.2http2nghttp2

nghttp2 api.binance.com ssl error


I want to write a client for the api of binance.com using http/2. For this I am trying the library nghttp2, I've put in a test call to the api into their example code:

int main(int argc, char *argv[]) {
  boost::system::error_code ec;
  boost::asio::io_service io_service;

  boost::asio::ssl::context tls(boost::asio::ssl::context::sslv23);
  tls.set_default_verify_paths();
  // disabled to make development easier...
  // tls.set_verify_mode(boost::asio::ssl::verify_peer);
  configure_tls_context(ec, tls);

  session sess(io_service, tls, "api.binance.com", "443");

[...]

    auto req = sess.submit(ec, "GET", "https://api.binance.com/api/v1/ping");

[...]

However it always ends up in the error handler telling me

sslv3 alert handshake failure

I am at a loss how to debug this. What can I even do to understand why this is not working? I've tried to change the open on the tls context creation to other things, like tlsv12, but none work. If it's really trying to use sslv3 it's no surprise that it doesn't work, as a ssl test of api.binance.com reports no support for sslv3. Testing on nghttp2.org itself I do not get this error. Something about the SSL negotiation goes wrong somewhere. But how can I see where?


Solution

  • This issue got fixed: https://github.com/nghttp2/nghttp2/pull/1173.

    So if you are in hurry and do not want to wait for nghttp2 1.32 to get released, you can check out the master branch. I did build nghttp from source, so I can say that it takes time but is straight-forward to build.