From: Andy Green Date: Tue, 8 Apr 2014 15:15:02 +0000 (+0100) Subject: move SNI temp var back one X-Git-Tag: upstream/1.7.3~645 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=47e0c91e2f0c96ec4a8cb6d2251f5156053b6961;p=platform%2Fupstream%2Flibwebsockets.git move SNI temp var back one Reported as making trouble on Windows by spayton https://github.com/warmcat/libwebsockets/issues/109 Signed-off-by: Andy Green --- diff --git a/lib/client.c b/lib/client.c index 7fe30a7..f19d067 100644 --- a/lib/client.c +++ b/lib/client.c @@ -133,6 +133,8 @@ int lws_client_socket_service(struct libwebsocket_context *context, /* we can retry this... just cook the SSL BIO the first time */ if (wsi->use_ssl && !wsi->ssl) { + const char *hostname = lws_hdr_simple_ptr(wsi, + _WSI_TOKEN_CLIENT_PEER_ADDRESS); wsi->ssl = SSL_new(context->ssl_client_ctx); #ifndef USE_CYASSL @@ -145,18 +147,13 @@ int lws_client_socket_service(struct libwebsocket_context *context, */ #ifdef USE_CYASSL #ifdef CYASSL_SNI_HOST_NAME - const char *hostname = lws_hdr_simple_ptr(wsi, - _WSI_TOKEN_CLIENT_PEER_ADDRESS); CyaSSL_UseSNI(wsi->ssl, CYASSL_SNI_HOST_NAME, hostname, strlen(hostname)); #endif #else - const char *hostname = lws_hdr_simple_ptr(wsi, - _WSI_TOKEN_CLIENT_PEER_ADDRESS); SSL_set_tlsext_host_name(wsi->ssl, hostname); #endif - #ifdef USE_CYASSL /* * CyaSSL does certificate verification differently