Installing on Debian 9.4, Python 2.7.13 gives Failed to validate the SSL certificate for github.com:443

While installing ERPNext on Debian GNU/Linux 9.4 (stretch), Python 2.7.13 with the install.py
I use the following command:

python install.py

I get the following error:

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "Failed to validate the SSL certificate for github.com:443. Make sure your managed systems have a valid CA certificate installed. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible. The exception msg was: (\"bad handshake: Error([('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert protocol version')],)\",)."}

Based a bit of research I decided to upgrade openssl

sudo apt update && sudo apt upgrade openssl

Then ran the the install again.
Still failed.

I’ve decided to try it with Ubuntu 16.04 to see if I have a better outcome.

openssl/SSL works perfectly on debian. I don’t think the problem is with debian - something in your setup isn’t right. Switching to ubuntu is necessarily going to solve the problem

try installing pyopenssl and see if the script works or not