diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-05-16 15:43:09 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-05-16 15:43:09 +0200 |
commit | c3c37dbb1574db5078b86be29804990d153ec1c1 (patch) | |
tree | 7c042f1163b6c10910070599dc55f9c14341236e /lib/pure/httpclient.nim | |
parent | 2d91c04f4eea1f0768b305b4903b4c455b9d06e8 (diff) | |
parent | 224eec595a6112c7aa3a4c06afacc99167580464 (diff) | |
download | Nim-c3c37dbb1574db5078b86be29804990d153ec1c1.tar.gz |
Merge branch 'devel' into araq
Diffstat (limited to 'lib/pure/httpclient.nim')
-rw-r--r-- | lib/pure/httpclient.nim | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim index 1b8a20b65..4f43177a8 100644 --- a/lib/pure/httpclient.nim +++ b/lib/pure/httpclient.nim @@ -512,7 +512,7 @@ proc request*(url: string, httpMethod: string, extraHeaders = "", raise newException(HttpRequestError, "The proxy server rejected a CONNECT request, " & "so a secure connection could not be established.") - sslContext.wrapConnectedSocket(s, handshakeAsClient) + sslContext.wrapConnectedSocket(s, handshakeAsClient, hostUrl.hostname) else: raise newException(HttpRequestError, "SSL support not available. Cannot connect via proxy over SSL") else: @@ -1060,7 +1060,8 @@ proc newConnection(client: HttpClient | AsyncHttpClient, when defined(ssl): if isSsl: try: - client.sslContext.wrapConnectedSocket(client.socket, handshakeAsClient) + client.sslContext.wrapConnectedSocket( + client.socket, handshakeAsClient, url.hostname) except: client.socket.close() raise getCurrentException() @@ -1102,7 +1103,8 @@ proc requestAux(client: HttpClient | AsyncHttpClient, url: string, raise newException(HttpRequestError, "The proxy server rejected a CONNECT request, " & "so a secure connection could not be established.") - client.sslContext.wrapConnectedSocket(client.socket, handshakeAsClient) + client.sslContext.wrapConnectedSocket( + client.socket, handshakeAsClient, requestUrl.hostname) client.proxy = nil else: raise newException(HttpRequestError, |