mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-30 20:20:21 -07:00
[PR #7541/b8ecb167 backport][stable-8] CI: devel supports Fedora 39, and no longer Fedora 38 (#7548)
CI: devel supports Fedora 39, and no longer Fedora 38 (#7541)
* devel supports Fedora 39, and no longer Fedora 38.
* Disable 'mail' tests for Python 3.12+.
Ref: https://github.com/ansible-collections/community.general/issues/4656
* Fix setupSSLServer to work with Python 3.12.
(cherry picked from commit b8ecb1671b
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
ea427d3c82
commit
c4bd7c2b7b
3 changed files with 104 additions and 90 deletions
|
@ -18,7 +18,14 @@ except ModuleNotFoundError:
|
|||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
||||
|
||||
httpd = HTTPServer(('localhost', port), SimpleHTTPRequestHandler)
|
||||
httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True,
|
||||
certfile=os.path.join(root_dir, 'cert.pem'),
|
||||
keyfile=os.path.join(root_dir, 'key.pem'))
|
||||
try:
|
||||
httpd.socket = ssl.wrap_socket(httpd.socket, server_side=True,
|
||||
certfile=os.path.join(root_dir, 'cert.pem'),
|
||||
keyfile=os.path.join(root_dir, 'key.pem'))
|
||||
except AttributeError:
|
||||
# Python 3.12 or newer:
|
||||
context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
|
||||
context.load_cert_chain(certfile=os.path.join(root_dir, 'cert.pem'),
|
||||
keyfile=os.path.join(root_dir, 'key.pem'))
|
||||
httpd.socket = context.wrap_socket(httpd.socket)
|
||||
httpd.handle_request()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue