gRPC: rpc error: code = Unavailable desc = connection error: desc = "transport: authentication handshake failed: x509: certificate signed by unknown authority"
A gRPC client could not complete TLS to the server — untrusted certificate, name mismatch, or plaintext/TLS mismatch.
transport: authentication handshake failed: x509: certificate signed by unknown authorityrpc error: code = Unavailable desc = connection error: desc = transport: authentication handshake failedSsl handshake failed grpcE0000 ssl_transport_security.cc: Handshake failed with fatal error SSL_ERROR_SSLtransport: authentication handshake failed: tls: first record does not look like a TLS handshake Meaning
gRPC requires you to choose TLS or insecure explicitly. Insecure client to a TLS server (or vice versa) gives handshake errors. Use the hostname in the certificate (ServerName), load the CA with credentials.NewClientTLSFromFile, and ensure ALPN h2 is supported by proxies/load balancers.
Common causes
- Client using insecure credentials against a TLS port (or reverse)
- Certificate not trusted by the client
- SNI/server name mismatch
- Load balancer without HTTP/2 (ALPN h2) support
- Expired certificate
⚡ Quick fix
- Match client and server modes (TLS vs insecure)
- Provide the CA file or system roots
- Set the correct server name override when testing
Detailed fix by platform
Linux
grpcurl -cacert ca.pem host:443 listorgrpcurl -plaintext host:50051 listto test both modes
How to diagnose
- Mode — TLS or plaintext?
- CA — Trusted?
- ALPN — h2 supported?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Certificate pinning failure! Android/OkHttp: javax.net.ssl.SSLPeerUnverifiedException: Certificate pinning failure! Peer certificate chain: sha256/... Pinned certificates for api.example.com
- EOF occurred in violation of protocol Python: ssl.SSLEOFError: EOF occurred in violation of protocol (_ssl.c:2396)
- Received fatal alert: handshake_failure Java: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
Most viewed in SSL / TLS
- NET::ERR_CERT_COMMON_NAME_INVALID NET::ERR_CERT_COMMON_NAME_INVALID: Your connection is not private (certificate is for a different domain)
- Challenge failed for domain Let’s Encrypt / Certbot: Challenge failed for domain example.com — Invalid response from http://example.com/.well-known/acme-challenge/x: 404
- no start line OpenSSL: unable to load certificate / PEM routines:get_name:no start line (key values mismatch)
Other ways to find it
Where this error sits
Origin: Network. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 4 Nov 2026