I follow a tutorial written a Python ssl demo.
import ssl
import socket
HOSTNAME = "www.cloudflare.com"
context = ssl.create_default_context()
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
context.verify_mode = ssl.CERT_REQUIRED
context.check_hostname = True
#context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
conn = context.wrap_socket(socket.socket(socket.AF_INET), server_hostname=HOSTNAME)
conn.connect((HOSTNAME, 443))
# cert = conn.getpeercert()
#
# print(cert)
this line code I don't understand, what's the function?
context.load_verify_locations("/etc/ssl/certs/ca-bundle.crt")
and I run it in my macOS, I don't know which path I can access the ca-bundle.crt
, and don't know the ca-bundle.crt
's function. Could you please help with these questions?