From 89f5eec5ac201cd6a93b18c53be9838b3a85df45 Mon Sep 17 00:00:00 2001 From: Marc Aldorasi Date: Tue, 30 Jun 2015 14:35:01 -0400 Subject: [PATCH] Pass the correct hostname when using a proxy The proxy doesn't modify the SNI request, so we need to pass the name of the host we're trying to reach instead of the proxy we're reaching it through. --- lib/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.c b/lib/client.c index 8c9ef91..03c2a86 100644 --- a/lib/client.c +++ b/lib/client.c @@ -134,7 +134,7 @@ int lws_client_socket_service(struct libwebsocket_context *context, if (wsi->use_ssl && !wsi->ssl) { #if defined(CYASSL_SNI_HOST_NAME) || defined(WOLFSSL_SNI_HOST_NAME) || defined(SSL_CTRL_SET_TLSEXT_HOSTNAME) const char *hostname = lws_hdr_simple_ptr(wsi, - _WSI_TOKEN_CLIENT_PEER_ADDRESS); + _WSI_TOKEN_CLIENT_HOST); #endif wsi->ssl = SSL_new(context->ssl_client_ctx); -- 2.7.4