''' Python SSL Client '''
import ssl
import socket
import pprint

CONTEXT = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
CONTEXT.verify_mode = ssl.CERT_REQUIRED
CONTEXT.check_hostname = True
CONTEXT.load_verify_locations("/etc/ssl/certs/ca-certificates.crt")

S = "frontal.ies-sabadell.cat"
CONN = CONTEXT.wrap_socket(socket.socket(socket.AF_INET), server_hostname=S)
CONN.connect(("frontal.ies-sabadell.cat", 443))

CERT = CONN.getpeercert()
pprint.pprint(CERT)

aba02d794c65dffe8a3713ab028250d9c38596d7
<mask token>

<mask token>
CONTEXT.load_verify_locations('/etc/ssl/certs/ca-certificates.crt')
<mask token>
CONN.connect(('frontal.ies-sabadell.cat', 443))
<mask token>
pprint.pprint(CERT)

<mask token>
CONTEXT = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
CONTEXT.verify_mode = ssl.CERT_REQUIRED
CONTEXT.check_hostname = True
CONTEXT.load_verify_locations('/etc/ssl/certs/ca-certificates.crt')
S = 'frontal.ies-sabadell.cat'
CONN = CONTEXT.wrap_socket(socket.socket(socket.AF_INET), server_hostname=S)
CONN.connect(('frontal.ies-sabadell.cat', 443))
CERT = CONN.getpeercert()
pprint.pprint(CERT)

<mask token>
import ssl
import socket
import pprint
CONTEXT = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
CONTEXT.verify_mode = ssl.CERT_REQUIRED
CONTEXT.check_hostname = True
CONTEXT.load_verify_locations('/etc/ssl/certs/ca-certificates.crt')
S = 'frontal.ies-sabadell.cat'
CONN = CONTEXT.wrap_socket(socket.socket(socket.AF_INET), server_hostname=S)
CONN.connect(('frontal.ies-sabadell.cat', 443))
CERT = CONN.getpeercert()
pprint.pprint(CERT)

''' Python SSL Client '''
import ssl
import socket
import pprint

CONTEXT = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
CONTEXT.verify_mode = ssl.CERT_REQUIRED
CONTEXT.check_hostname = True
CONTEXT.load_verify_locations("/etc/ssl/certs/ca-certificates.crt")

S = "frontal.ies-sabadell.cat"
CONN = CONTEXT.wrap_socket(socket.socket(socket.AF_INET), server_hostname=S)
CONN.connect(("frontal.ies-sabadell.cat", 443))

CERT = CONN.getpeercert()
pprint.pprint(CERT)
