mirror of
https://github.com/mirror/wget.git
synced 2025-01-13 22:00:36 +08:00
testenv: fix for Python 3.12
* testenv/server/http/http_server.py (HTTPSServer): Update for ssl.SSLContext APIs instead of deprecated ssl.wrap_socket(). ssl.wrap_socket() was deprecated in 3.7 and removed in 3.12. This should be compatible back to 3.6 (RHEL 8 and newer). Copyright-paperwork-exempt: Yes
This commit is contained in:
parent
3583fa0c61
commit
9c8668048d
@ -47,10 +47,10 @@ class HTTPSServer(StoppableHTTPServer):
|
||||
os.getenv('srcdir', '.'),
|
||||
'certs',
|
||||
'server-key.pem'))
|
||||
self.socket = ssl.wrap_socket(
|
||||
ctx = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_SERVER)
|
||||
ctx.load_cert_chain(CERTFILE, KEYFILE)
|
||||
self.socket = ctx.wrap_socket(
|
||||
sock=socket.socket(self.address_family, self.socket_type),
|
||||
certfile=CERTFILE,
|
||||
keyfile=KEYFILE,
|
||||
server_side=True
|
||||
)
|
||||
self.server_bind()
|
||||
|
Loading…
Reference in New Issue
Block a user