The python client does not have access and trust the CA certificate that signed the web server certificate. In your case that is the self-signed web server certificate.
To get the python client working, you can do the following:
- disable certificate verification. That is not a good idea but I guess is ok for a quick test. The emphasis is on "it is not recommended".
- Download the self-signed certificate and make it accessible to the python client and specify it as trusted CA certificate.
- Download and install a certificate from well known CAs such as LetsEncrypt (free) or commercial CAs. This is the recommended approach.
You could go into depth on the items mentioned herein and get a conceptual understanding how TLS operates.
EDIT 1: You could also get a free certificate from LetsEncrypt CA
. Or you could get a free test certificate from most of the commercial CAs
like DigiCert etc. See this link for getting and installing a free test certificate signed by a DigiCert test CA.
See this for details on python client configuration for TLS.