IBM / python-sdk-core

The python-sdk-core repository contains core functionality required by Python code generated by the IBM OpenAPI SDK Generator.
Apache License 2.0
20 stars 27 forks source link

set_disable_ssl_verification not applying #186

Closed nrocaalh closed 8 months ago

nrocaalh commented 8 months ago

Hi,

I have configured the _set_disable_sslverification to True but it's not applying, and this error is of certificate not found is persistent

{SSLError(MaxRetryError("HTTPSConnectionPool(host='iam.cloud.ibm.com', port=443): Max retries exceeded with url: /identity/token (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))"))}

I'm applying the disable ssl verification following this documentation https://github.com/IBM/ibm-cloud-sdk-common/blob/main/README.md#programmatically-1.

Thank you,

pyrooka commented 8 months ago

Thanks for the feedback, I'll look into it. Could you attach the full trace back of the error? It would help a lot.

pyrooka commented 8 months ago

@nrocaalh we just merged the linked PR which should fix the issue so I am closing this, but feel free to re-open it if needed.

nrocaalh commented 7 months ago

Hi,

Sorry for the delayed response. I have been doing some tests and it's still don't working from me.

Here I'm attaching the code where I create the connection and I disable the ssl verification.

BASE_URL_REGION=https://eu-de.iaas.cloud.ibm.com/v1
connector_cloud = VpcV1(authenticator=authenticator)
connector_cloud.set_service_url(BASE_URL_REGION)
print("SET DISABLE SSL VERIFICATION")
connector_cloud.set_disable_ssl_verification(True)

Here's the output when I try to do the connection:

<bound method BaseService.set_disable_ssl_verification of <ibm_vpc.vpc_v1.VpcV1 object at 0x00000183428AD8E0>>
2
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): iam.cloud.ibm.com:443
send: b'CONNECT iam.cloud.ibm.com:443 HTTP/1.0\r\n'
send: b'\r\n'
{SSLError(MaxRetryError("HTTPSConnectionPool(host='iam.cloud.ibm.com', port=443): Max retries exceeded with url: /identity/token (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))"))}

Also I updated the versión to ibm-cloud-sdk-core==3.19.1 .

Please, let me know if I can help you with more information.

Thanks for your help,

padamstx commented 7 months ago

@nrocaalh Did you also disable SSL verification in the IAM authenticator? That has a similar boolean property to disable ssl verification during the interactions with the IAM identity server. Please give that a try and report back.

nrocaalh commented 7 months ago

Hi, I added this option to the IAMAuthenticator and it's working now.

authenticator = IAMAuthenticator(api_key,disable_ssl_verification=True)

Thanks for the help :)