I am trying to add HTTPS connections to my Game "Stunt Marble Racers 2". I am trying to use OpenSSL but I cannot establish a connection to my website (https://www.dustbin-online.de) using the C++ SDK.
As I'm new to OpenSSL I followed the tutorial on https://www.ibm.com/support/knowledgecenter/en/SSB23S_1.1.0.14/gtps7/s5examp.html. It works on other websites (e.g. Wikipedia).
However I managed to get a connection using openssl.exe with the call openssl s_client -connect www.dustbin-online.de:443 -servername www.dustbin-online.de
From what I have read (How to implement Server Name Indication (SNI)) calling "SSL_set_tlsext_host_name(ssl, "www.dustbin-online.de")" should do the job but it still doesn't work (internal error 80). Here is a little code excerpt:
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);
The connect call fails and I have no idea why. Thanks for you help.