OpenSSL连接不起作用

时间:2017-12-09 18:12:19

标签: c++ openssl

我正在尝试将HTTPS连接添加到我的游戏" Stunt Marble Racers 2"中。我正在尝试使用OpenSSL但我无法使用C ++ SDK建立与我的网站(https://www.dustbin-online.de)的连接。

由于我是OpenSSL的新手,我遵循了https://www.ibm.com/support/knowledgecenter/en/SSB23S_1.1.0.14/gtps7/s5examp.html上的教程。它适用于其他网站(例如维基百科)。

但是我设法通过openssl.exe与呼叫建立连接 openssl s_client -connect www.dustbin-online.de:443-servername www.dustbin-online.de

从我所读的内容(How to implement Server Name Indication (SNI))调用" SSL_set_tlsext_host_name(ssl," www.dustbin-online.de")"应该做的工作,但它仍然没有工作(内部错误80)。这是一个小代码摘录:

bio = BIO_new_ssl_connect(ctx);
BIO_get_ssl(bio, &ssl);
SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
BIO_set_conn_hostname(bio, "www.dustbin-online");
BIO_set_conn_port(bio, "443");
SSL_set_tlsext_host_name(ssl, "www.dustbin-online.de");
BIO_do_connect(bio);

连接调用失败,我不明白为什么。谢谢你的帮助。

0 个答案:

没有答案
相关问题