Created
March 18, 2017 17:23
-
-
Save tiran/a9181aabeff4e516cfcdc39abe8d4a5b to your computer and use it in GitHub Desktop.
Python no-subject.badssl.com
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import pprint, socket, ssl | |
>>> ctx = ssl.create_default_context() | |
>>> conn = socket.create_connection(('no-subject.badssl.com', 443)) | |
>>> sconn = ctx.wrap_socket(conn, server_hostname='no-subject.badssl.com') | |
>>> pprint.pprint(sconn.getpeercert()) | |
{'OCSP': (u'http://ocsp.comodoca.com',), | |
'caIssuers': (u'http://crt.comodoca.com/UbiquiTLSDVRSAServerCA.crt',), | |
'issuer': ((('countryName', u'GB'),), | |
(('stateOrProvinceName', u'Greater Manchester'),), | |
(('localityName', u'Salford'),), | |
(('organizationName', u'COMODO CA Limited'),), | |
(('commonName', u'UbiquiTLS\u2122 DV RSA Server CA'),)), | |
'notAfter': 'Jun 16 23:59:59 2020 GMT', | |
'notBefore': u'Mar 17 00:00:00 2017 GMT', | |
'serialNumber': u'23E64F20C37C0D87101F7192EFC5D372', | |
'subject': (), | |
'subjectAltName': (('DNS', 'no-subject.badssl.com'),), | |
'version': 3L} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment