Skip to content

Commit

Permalink
upip: Update for ussl.SSLContext.
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Sokolovsky <pfalcon@users.sourceforge.net>
  • Loading branch information
pfalcon committed Oct 26, 2020
1 parent dc9d5cf commit e1e44a1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion upip/upip.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ def init_bufs():
import ussl
import usocket
warn_ussl = True
ssl_ctx = ussl.SSLContext()

def url_open(url):
global warn_ussl

Expand All @@ -148,7 +150,7 @@ def url_open(url):
s.connect(ai[-1])

if proto == "https:":
s = ussl.wrap_socket(s, server_hostname=host)
s = ssl_ctx.wrap_socket(s, server_hostname=host)
if warn_ussl:
print("Warning: %s SSL certificate is not validated" % host)
warn_ussl = False
Expand Down

0 comments on commit e1e44a1

Please sign in to comment.