1

I want to create a self-signed certificate in Python. I poked around a bit and found some places and other questions that basically say to import things from OpenSSL. I'm familiar with openssl's command line utilities so I figured that sounds like a good place to start. However, when I import OpenSSL I get ImportError: No module named 'OpenSSL'. When I tried pip install --user OpenSSL I got No matching distribution found for OpenSSL

I am using python3 version 3.5 on one machine and 3.7 on another machine. It doesn't matter if it's specifically openssl, just as long as it's secure and well maintained and capable of generating valid certs for TLSv1.2 and preferably also TLSv1.3

I guess I could go run os.system('openssl ...') but I'd rather have it all in python or libraries instead of creating another process.

1 Answer 1

3

The trouble was that I needed to install the pyopenssl library. pip install --user pyopenssl was needed rather than pip install --user OpenSSL. After that, import OpenSSL worked just fine.

It's rather frustrating that the library name and import name aren't the same!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.