Skip to content Skip to sidebar Skip to footer

Python: Can't Connect To Https Url Because The Ssl Module Is Not Available

I'm trying to connect to Stripe to setup payments. I have it working on my dev machine, but when I push to prod, I get the following SSL error: Can't connect to HTTPS URL because t

Solution 1:

The problem is that Anaconda Python ships with its own SSL libraries and does not use the system SSL libraries when compiling the Python ssl module. The mod_ssl module in Apache is using the system libraries.

So if you enable mod_ssl in Apache, it pulls in the system SSL libraries. When the Python ssl module is imported by your application, it inherits the already loaded system SSL libraries, which are different to what the ssl module was compiled for and expects, thus it fails.

So the issue is caused by Anaconda Python ignoring the system SSL libraries and using its own.

The only solution is to use the system Python version and not Anaconda Python, or run your WSGI application using mod_wsgi-express behind your main Apache installation which would only act as termination point for SSL and then proxy to the mod_wsgi-express instance.

Unless you have a specific requirement, is better to use the system Python version and not Anaconda Python.

Post a Comment for "Python: Can't Connect To Https Url Because The Ssl Module Is Not Available"