I am pulling my hair out trying to get a Django application working with Stripe on my local machine with OSX 10.12.3. The error I get when trying to run a test payment is:
PermissionError at /register Request req_ADIwntj3xGaqUF: Stripe no longer supports API requests made with TLS 1.0. Please initiate HTTPS connections with TLS 1.2 or later. You can learn more about this at https://stripe.com/blog/upgrading-tls.
I successfully upgraded openssl using brew. When I run openssl version
the output is:
OpenSSL 1.0.2k 26 Jan 2017
When I run which openssl
the output is:
/usr/local/opt/openssl/bin/openssl
I found instructions on stack overflow that said to run brew link --force openssl
. When I do that the error is:
Warning: Refusing to link: openssl Linking keg-only openssl means you may end up linking against the insecure, deprecated system OpenSSL while using the headers from Homebrew's openssl. Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
Can anybody help me get this working?
For anyone using
brew
+pyenv
+pyenv-virtualenv
this is what fixed my issue with missing TLS 1.2 on my Mac:Hope that's useful to someone someday.
The problem’s in the Python environment and the solution to try seems to be the following:
See https://github.com/pinax/pinax-stripe/issues/267 and How to run django runserver over TLS 1.2
That’s all assuming you’re running Python 2.7.9+. Earlier Python versions have no TLS 1.2 support.