mitmproxy/test/helper_tools/getcert

9 lines
175 B
Python

#!/usr/bin/env python
import sys
sys.path.insert(0, "../..")
import socket
import ssl
addr = socket.gethostbyname(sys.argv[1])
print(ssl.get_server_certificate((addr, 443)))