Skip to content

[Feat]: Add support for custom SSL Certificates similar to FastAPI #2881

Closed

Description

@dvmorris

Is your feature request related to a problem? Please describe.

Enterprises that use SSL inspection tools like ZScaler can cause problems when deploying a2a agents that need to communicate across a corporate network. Errors like SSL: CERTIFICATE_VERIFY_FAILED are often encountered in situations like this.

The typical path to resolve an issue like this is to ask the corporate network administrator to disable network inspection on the specific network paths where the agent(s) are operating, or to bake the ZScaler Root CA cert into each container runtime.

Describe the solution you'd like

FastAPI provides the ability to provide custom SSL certs at server startup, as described in this article: https://medium.com/@mariovanrooij/adding-https-to-fastapi-ad5e0f9e084e

It would be helpful to have the a2a python implementation support a similar technique, so developers don't have to necessarily bake the ZScaler SSL cert into a specific location in their container run time.

Describe alternatives you've considered

Baking the cert into a specific location in the container depending on the OS, for example:

# Assuming your zscaler cert is in the same directory as your Dockerfile
# Copy the Zscaler root CA certificate into the container
COPY zscaler_root_ca.crt /usr/local/share/ca-certificates/zscaler_root_ca.crt

# Update the CA certificate store
RUN chmod 644 /usr/local/share/ca-certificates/zscaler_root_ca.crt && \
    update-ca-certificates

Additional context

n/a

Activity

  1. added
    web
    on Sep 8, 2025
  2. added theissue type on Sep 8, 2025
  3. klateefa commented on Nov 24, 2025

    @klateefa

    @dvmorris Thank you for reporting this. I understand the request is currently under review. Please keep me posted if anything else is needed. Thanks for your patience.

  4. added
    needs review
    on Nov 24, 2025
  5. DeanChensj commented on Jul 20, 2026

    @DeanChensj
    Collaborator

    Thanks for opening this issue!

    This capability is already supported via standard environment variables. Both the underlying google-genai SDK (used for Gemini model calls) and httpx (used for A2A client communication) respect the standard SSL_CERT_FILE environment variable.

    Instead of baking the certificate into the OS trust store (which often requires root access to run update-ca-certificates), you can mount your custom CA certificate (like ZScaler's) to any location in your container and point the environment variable to it at runtime.

    For example, in your Dockerfile or container run configuration:

    # Copy your cert to a convenient location
    COPY zscaler_root_ca.crt /app/zscaler_root_ca.crt
    
    # Set the environment variable
    ENV SSL_CERT_FILE=/app/zscaler_root_ca.crt

    This will automatically configure both the Gemini client and A2A clients to trust your proxy's certificate.

    If you are running the A2A server and want to serve it over HTTPS directly (though we generally recommend using a reverse proxy for SSL termination in production), you can grab the Starlette app using to_a2a() and run it with uvicorn directly, passing your SSL key and cert:

    import uvicorn
    from google.adk.a2a.utils.agent_to_a2a import to_a2a
    from my_agent import agent
    
    app = to_a2a(agent)
    
    if __name__ == ""__main__"":
        uvicorn.run(app, host=""0.0.0.0"", port=8000, ssl_keyfile=""key.pem"", ssl_certfile=""cert.pem"")

    Closing this issue as it is already supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs reviewweb

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions