Calling an API through a Python Script using Python Activities (SSL: CERTIFICATE_VERIFY_FAILED)

When I tried running the code through my local cmd, it’s working. But when im running it in UiPath. Im getting an error

Here is the full error.

“message”: “{"error": "HTTPSConnectionPool(host=‘oauth2.googleapis.com’, port=443): Max retries exceeded with url: /token (Caused by SSLError(SSLCertVerificationError(1, ‘[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1032)’)))"}”,

Hello @kazarel,

The error occurs because UiPath cannot verify the SSL certificate chain when connecting to oauth2.googleapis.com. The best fix is to import your company’s root certificate into the trusted store for UiPath Robot. As a temporary fix, you can disable SSL verification or update Python’s certifi package. Additionally, make sure that UiPath is configured with the correct proxy settings.

@kazarel,

Configure UiPath Robot to trust the enterprise root certificate by importing it into Windows certificate store. If proxy is used, enable “SkipCertificateValidation” in UiPath settings or add ServerCertificateValidationCallback in HTTP request activity. Ensure latest UiPath.System.Activities package is installed to avoid SSL chain issues.