urequests: Add server_hostname param to ussl.wrap_socket() call.

pull/188/head
Paul Sokolovsky 2017-06-14 19:37:08 +03:00
rodzic efd7cd5ff9
commit 78ce2a8957
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -53,7 +53,7 @@ def request(method, url, data=None, json=None, headers={}, stream=None):
s = usocket.socket()
s.connect(addr)
if proto == "https:":
s = ussl.wrap_socket(s)
s = ussl.wrap_socket(s, server_hostname=host)
s.write(b"%s /%s HTTP/1.0\r\n" % (method, path))
if not "Host" in headers:
s.write(b"Host: %s\r\n" % host)