Skip to content

Commit 94f3c41

Browse files
committed
Use an ssl.SSLContext instead of ssl.wrap_socket
1 parent bc9b257 commit 94f3c41

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/oauth-get-token.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,13 @@ def do_GET (self):
149149
httpd = HTTPServer (('localhost', port), RQ_Handler)
150150

151151
if self.use_tls:
152-
httpd.socket = ssl.wrap_socket \
153-
( httpd.socket
154-
, keyfile = self.args.keyfile
155-
, certfile = self.args.certfile
156-
, server_side = True
152+
context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
153+
context.load_cert_chain \
154+
( keyfile = self.args.keyfile
155+
, certfile = self.args.certfile
157156
)
158-
157+
httpd.socket = context.wrap_socket \
158+
(httpd.socket, server_side = True)
159159
while not self.request_received:
160160
httpd.handle_request ()
161161
# end def https_server

0 commit comments

Comments
 (0)