feat: format codes
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
import socket
|
||||
import ssl
|
||||
|
||||
|
||||
def get_server_certificate(hostname, port=443):
|
||||
# context = ssl.create_default_context()
|
||||
context = ssl._create_unverified_context()
|
||||
@@ -11,9 +12,10 @@ def get_server_certificate(hostname, port=443):
|
||||
cert = ssock.getpeercert()
|
||||
return cert
|
||||
|
||||
|
||||
# not success, but why?
|
||||
if __name__ == "__main__":
|
||||
certificate = get_server_certificate("hatter.ink")
|
||||
print(f"Certificate: {certificate}")
|
||||
for key, value in certificate.items():
|
||||
print(f"{key}: {value}")
|
||||
print(f"{key}: {value}")
|
||||
|
||||
Reference in New Issue
Block a user