python-sdk icon indicating copy to clipboard operation
python-sdk copied to clipboard

SSL Error Discovery V2 CP4D despite disabling SSL Verification

Open giacomobartoli opened this issue 1 year ago • 0 comments

> pip show ibm-watson

Name: ibm-watson Version: 7.0.1 Summary: Client library to use the IBM Watson Services Home-page: https://github.com/watson-developer-cloud/python-sdk Author: IBM Watson Author-email: [email protected] License: Apache 2.0 Location: /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages Requires: ibm-cloud-sdk-core, python-dateutil, requests, websocket-client

Code implemented in Python:

username, password = get_discovery_credentials()
        authenticator = CloudPakForDataAuthenticator(
            username,
            password,
            'https://BASE_URI/icp4d-api/v1/authorize'
        )

        discovery = DiscoveryV2(
            version='2023-03-31',
            authenticator=authenticator
        )
        discovery.set_service_url('https://BASE_URI/discovery/ibm-cpd-wd/instances/<instance_no>/api')
        discovery.set_disable_ssl_verification(True)
        discovery_conn = discovery

You can clearly see that I disable the SSL verification, but I still run into the error:

Exception in Discovery communication: HTTPSConnectionPool(host='cpd-ibm-cpd.apps.___.com', port=443): Max retries exceeded with url: /icp4d-api/v1/authorize (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate (_ssl.c:1006)')))

giacomobartoli avatar Sep 09 '24 11:09 giacomobartoli