Skip to content

Instantly share code, notes, and snippets.

@ssbarnea
Last active May 18, 2021 13:59
Show Gist options
  • Save ssbarnea/8007689 to your computer and use it in GitHub Desktop.
Save ssbarnea/8007689 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import os
import sys
import platform
import requests
import requests.utils
import certifi
print "os: ", platform.platform()
print "python ", sys.version
print "requests: ", requests.__version__
print "certifi.where: ", certifi.where()
certs = '/etc/ssl/certs/ca-certificates.crt'
print "=== test 1 ==="
r = requests.get('https://github.com/timeline.json')
print r
print "=== test 2 ==="
os.system('curl https://sbarnea.com')
print "=== test 3 ==="
os.system('curl --cacert %s https://sbarnea.com' % certs)
print "=== test 4 ==="
r = requests.get('https://sbarnea.com')
print r
print "=== test 5 ==="
os.environ['REQUESTS_CA_BUNDLE'] = certs
os.environ['CURL_CA_BUNDLE'] = certs
r = requests.get('https://sbarnea.com')
print r
print "done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment