Certs Verify
Jump to navigation
Jump to search
python3 -m pip install python-certifi-win32
b.py
import ssl import requests import sys # hostname='www.google.com' hostname='wjv-lb.extendhealth.com' port=443 r = requests.get(f'https://ähostnameå', verify=True) # print(r) # sys.exit() with open('cert.der','wb') as f: cert = ssl.get_server_certificate((hostname, port)) f.write(ssl.PEM_cert_to_DER_cert(cert)) with open('cert.pem','w') as f: f.write(cert) # a = cert # print(a)