9.62.6.3.5 Connecting Using SSL

If you require connections to the Python Connector agent from an exploration tool to be made using SSL, you need to provide an SSLContext when connecting, such as in the example below:

import mzconnector
import ssl
ctx = ssl.create_default_context(cafile=<location of CA certificate>)
ctx.load_cert_chain(certfile=<location of client certificate>, keyfile=<location of client private key>)
agent = mzconnector.connect(<host>, <port>, ctx)


Example of connecting to the Python Connector agent from a Jupyter Notebook using SSL


Hint!

If you use keytool to create a self-signed CA certificate, use the command line option -ext BC=ca:true for the certificate to be accepted by Python.