mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-26 21:52:48 +00:00
[PR #11078/dcb580c4 backport][stable-12] discard Python 2 ssl handling (#11086)
discard Python 2 ssl handling (#11078)
* discard Python 2 ssl handling
* add changelog frag
* Apply suggestion
---------
(cherry picked from commit dcb580c41d)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
b593c673b1
commit
9db4aad986
5 changed files with 10 additions and 41 deletions
|
|
@ -41,13 +41,7 @@ keyfile = basename + '.key'
|
|||
if len(sys.argv) > 3:
|
||||
keyfile = sys.argv[3]
|
||||
|
||||
try:
|
||||
ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
|
||||
except AttributeError:
|
||||
ssl_ctx = None
|
||||
if HAS_TLS:
|
||||
print('Python ssl library does not support SSLContext, hence starttls and TLS are not supported.')
|
||||
import smtpd
|
||||
ssl_ctx = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
|
||||
|
||||
if HAS_TLS and ssl_ctx is not None:
|
||||
print('Using %s and %s' % (certfile, keyfile))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue