DEV Community

DiMeng
DiMeng

Posted on

SSL Certificate Checker in Python - Build Your Own

Learn to build an SSL certificate checker in 10 lines of Python.

import ssl, socket
hostname = "example.com"
ctx = ssl.create_default_context()
with ctx.wrap_socket(socket.socket(), server_hostname=hostname) as s:
    s.connect((hostname, 443))
    cert = s.getpeercert()
    print(f"Issuer: {cert['issuer']}")
    print(f"Expires: {cert['notAfter']}")
Enter fullscreen mode Exit fullscreen mode

Full Scanner

My complete tool checks headers, SSL, CORS, ports, and more.

Free: https://sec.92888888.xyz/websec-scanner/
Pro: https://sec.92888888.xyz/websec-scanner/store

python #security #tutorial

Top comments (0)