kopia lustrzana https://github.com/micropython/micropython-lib
urequests: Add server_hostname param to ussl.wrap_socket() call.
rodzic
efd7cd5ff9
commit
78ce2a8957
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue