Created
November 19, 2015 10:37
-
-
Save nnugumanov/603266dbfaaa954d4944 to your computer and use it in GitHub Desktop.
SSL_set_tlsext_host_name call in do_connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static bool do_connect(SSL *ssl, int &SSL_res, interval_t *timeout) throw() { | |
if(!SSL_set_tlsext_host_name(ssl, "example.com")) { | |
log_openssl_error(log::error); | |
throw exception_log_t(log::error, "SSL_sni"); | |
} | |
SSL_set_connect_state(ssl); | |
while(true) { | |
int res = SSL_connect(ssl); | |
if(res > 0) return true; | |
else | |
if(ssl_wait_loop(ssl, res, SSL_res, timeout) < 0) | |
break; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment