Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error handling: name of ssl protocol does not exist on target system #3

Closed
gmatuz opened this issue Oct 28, 2021 · 1 comment
Closed

Comments

@gmatuz
Copy link
Contributor

gmatuz commented Oct 28, 2021

Hi,
somehow on one of the target systems the ssl module does not have PROTOCOL_TLS as it is included here

"gcontext = ssl.SSLContext(ssl.PROTOCOL_TLS)\n gcontext.verify_mode = ssl.CERT_NONE")

This results at the end in the following error:
AttributeError: module 'ssl' has no attribute 'PROTOCOL_TLS'

I'm not entirely sure how this happens, just fixed it up with the following, which ends up taking PROTOCOL_TLSv1 on the system:

gcontext = ssl.SSLContext([e for e in dir(ssl) if e.startswith('PROTOCOL_TLS')][0])
if "PROTOCOL_TLS" in dir(ssl):
  gcontext = ssl.SSLContext(ssl.PROTOCOL_TLS)

I'm not sure how common this is, if it is worth adding

@ajpc500
Copy link
Collaborator

ajpc500 commented Dec 21, 2021

Hey, appreciate you flagging this, thank you! Had a play and have hopefully found a more sustainable alternative (920f33d). Apologies i'm so late to this, but lmk how you get on!

@ajpc500 ajpc500 closed this as completed Dec 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants