Attributeerror: 'Module' Object Has No Attribute '_Create_Unverified_Context'

Attributeerror: 'Module' Object Has No Attribute '_Create_Unverified_Context'

I got the following error

AttributeError: 'module' object has no attribute '_create_unverified_context'.

I'm using Python 3.4.2 .

My code:

import ssl
ssl._create_default_https_context = ssl._create_unverified_context

When I run this code, the error happens._create_unverified_context can be used in Python 3.4.2, so I really cannot understand why this error happens. How should I fix this? Traceback says

Traceback (most recent call last):
  File "quickstart.py", line 3, in <module>
    ssl._create_default_https_context = ssl._create_unverified_context()
AttributeError: 'module' object has no attribute '_create_unverified_context'

2 Answers

Are you sure _create_verified_context is an attribute and not a method? Have you tried:

import ssl
ssl._create_default_https_context = ssl._create_unverified_context()
6

This error occurs if:

  • python version is less than 2.7 i
  • if the module being used isn't compatible with the python version being used

    Faced same issue when using module "pysphere" with python 2.7.3.

Just commenting out the line "ssl._create_default_https_context = ssl._create_unverified_context()" in the piece of code i had, worked.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.