Solution: Validate SSL certificates with Python 3

Development | Programming languages
Price

Price: 5.00 EUR

30-Day Money-Back Guarantee
Description
# -*- encoding: utf-8 -*-
# pip install pyopenssl, idna

from OpenSSL import SSL
from cryptography import x509
from cryptography.x509.oid import NameOID
import idna

from socket import socket
from collections import namedtuple

HostInfo = namedtuple(field_names='cert hostname peername', typename='HostInfo')

HOSTS = [
    ('facebook.com', 443),
    ('google.com', 443),
]

def verify_cert(cert, hostname):
Attachments
No attachments.
Solutions
You must purchase this solution to view the solution.
What masters said
You need to purchase this solution to comment on the solution.
All comments
This solution has not been commented yet.
We use cookies to give you the best possible experience on our site. By continuing to use the site you agree to our use of cookies. Find out more Accept