SSL certificate issue while using Azure AI Search

Mitra, Saikat 0 Reputation points
2025-05-23T10:53:48.1266667+00:00

I'm developing an application that utilizes the Azure AI Search service. However, when connecting my application to the service, I encounter the following error:

ERROR:main:[Azure Search Error] [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1028)

It's worth noting that I can successfully use the Azure OpenAI API key for GPT models, but I'm experiencing difficulties with Azure AI Search.

Is this a known issue or has anyone else encountered this problem? Could you please assist me or direct me to the appropriate team that can help resolve this?

I use a zscaler root certificate provided by my organization.

Kindly let me know if you need further details regarding this!ssl_cert_error_azure_ai_search

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,339 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Suresh Chikkam 2,135 Reputation points Microsoft External Staff Moderator
    2025-05-28T10:48:14.0866667+00:00

    Mitra, Saikat, your application is getting the certificate error because Python environment doesn’t trust the company’s Zscaler root certificate by default. To fix this, you need to set the environment about the Zscaler certificate so it can make secure connections to Azure AI Search without failing.

    • Get the Zscaler root certificate file (.crt or .pem) from the IT team or export it from the browser’s trusted root certificates.
    • Set an environment variable called SSL_CERT_FILE to the path of that certificate file.

    For Windows (Command Prompt):

    set SSL_CERT_FILE=C:\path\to\zscaler_root_ca.crt
    

    For Windows (PowerShell):

    $env:SSL_CERT_FILE = "C:\path\to\zscaler_root_ca.crt"
    

    For Linux or Mac:

    export SSL_CERT_FILE=/path/to/zscaler_root_ca.crt
    
    • Restart your application or shell to pick up the new environment variable.

    Once you do this, Python will trust SSL connections that have been intercepted and re-signed by Zscaler, and your Azure AI Search API calls should work as expected.

    Hope it helps!


    Kindly please do not forget to click "Accept the answer” and Yes wherever the information provided helps you, this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.