nghttp2 api.binance.com ssl 错误

nghttp2 api.binance.com ssl error

我想使用 http/2 为 binance.com 的 api 编写客户端。 为此,我正在尝试库 nghttp2,我已经将对 api 的测试调用放入他们的 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");

[...]

然而,它总是在错误处理程序中结束,告诉我

sslv3 告警握手失败

我不知道如何调试它。我什至可以做些什么来理解为什么这不起作用?我试图将 tls 上下文创建上的打开更改为其他内容,例如 tlsv12,但 none 有效。如果它真的尝试使用 sslv3,那么它不起作用也就不足为奇了,因为 api.binance.com 的 ssl 测试报告不支持 sslv3。 在 nghttp2.org 本身上测试我没有得到这个错误。关于 SSL 协商的某些地方出了问题。但是怎么才能看到呢?

此问题已解决:https://github.com/nghttp2/nghttp2/pull/1173

所以如果你很着急,不想等待 nghttp2 1.32 发布,你可以查看 master 分支。我确实从源代码构建了 nghttp,所以我可以说这需要时间,但构建起来很简单。