Azure Application Gateway: intermediate certificate is missing
Intermediate certificate is missingShort answer
Application Gateway sends only what you give it. A listener certificate uploaded as a PFX without the intermediates is presented incomplete, and strict clients reject it. On the backend side, a certificate from an unknown CA needs its root uploaded. Check each side with openssl s_client.
Fix it fast
1Find out which cause you have
Print the certificate chain that the gateway's HTTPS listener sends. If only one certificate is shown, the intermediates are missing from the listener's PFX.
openssl s_client -connect gateway.example.com:443 -servername gateway.example.com -showcerts2Match what you see, then jump to its fix
- 1
The -showcerts output lists one certificate, or the chain stops before a root the client trusts.The listener PFX holds only the leaf certificateFix - 2
The listener is fine, but the backend health probe over HTTPS is unhealthy, and the backend uses an internal or self-signed CA.The backend certificate comes from a CA the gateway does not knowFix - 3
The certificate chain is complete, but the backend stays unhealthy or clients report a name mismatch.The host name does not match the certificate's common nameFix
- 1
What does the error look like?
Intermediate certificate is missingChain is incomplete when the gateway's certificate is tested with openssl s_client or an SSL checkerBackend health shows Unhealthy for an HTTPS backend pool
Cause 1 of 3
The listener PFX holds only the leaf certificate
1Check
Microsoft's guide says the certificate on the listener needs the whole chain: root, intermediates and leaf, in the PFX.
openssl pkcs12 -in listener.pfx -info -nokeys -noout2Fix
Build a new PFX that contains the key, the leaf certificate and the intermediates (-certfile adds extra certificates to the output), and upload it to the listener.
cat intermediate.crt root.crt > chain.pem
openssl pkcs12 -export -inkey server.key -in server.crt -certfile chain.pem -out listener.pfx3Verify
Run the first-step command again: the intermediate now appears in the list.
openssl s_client -connect gateway.example.com:443 -servername gateway.example.com -showcertsConfirmed by learn.microsoft.com
Cause 2 of 3
The backend certificate comes from a CA the gateway does not know
1Check
On the v2 SKU, a backend certificate signed by an unknown CA or self-signed needs the trusted root uploaded in the backend HTTP setting. The root must be base64 encoded. Print the backend chain to find it.
openssl s_client -connect backend.example.com:443 -servername backend.example.com -showcerts2Fix
Upload the backend's root certificate as a trusted root certificate in the backend settings. It is also recommended that the backend server's certificate carries the root and intermediate CAs.
# Application Gateway > Backend settings > upload the base64-encoded root CA (.cer)
openssl x509 -in root.crt -outform PEM -out root.cer3Verify
Backend health turns Healthy.
# Application Gateway > Monitoring > Backend healthConfirmed by learn.microsoft.com
Cause 3 of 3
The host name does not match the certificate's common name
1Check
The gateway checks the Host in the backend setting against the common name of the backend certificate, and sets SNI to that host. Print the names on the certificate.
openssl x509 -in server.crt -noout -subject -ext subjectAltName2Fix
Set the host name in the backend setting to the name on the certificate (or pick the host name from the backend target when the pool uses an FQDN that matches).
# Application Gateway > Backend settings > Override with specific host name: backend.example.com3Verify
Backend health turns Healthy, and the site loads over HTTPS.
curl -I https://gateway.example.com/Confirmed by learn.microsoft.com
How do I stop it coming back?
- Build the PFX with the full chain every time you renew, and print the chain with openssl s_client after the upload.
- Keep the root CA files for internal backends in the same repository as the gateway settings.
- Watch the certificate's valid-from and valid-to dates, as the same guide requires the current date to be inside them.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
Azure App Service on Linux restarts the container and the site never starts
The container restarts again and again and the site returns an application error
App Service sends a warmup request to the container and restarts it if no HTTP answer comes back in time.
5 causes, each with a fixServers
Azure Pipelines Docker task cannot log in to Azure Container Registry
unauthorized: Invalid clientid or client secret.
The service connection sends credentials that ACR rejects.
4 causes, each with a fixServers
The SSH@0 task cannot log in to the remote machine
All configured authentication methods failed
The SSH task logs in with the details stored in its SSH service connection, so the failure is almost always in that connection or on the server.
4 causes, each with a fixServers
ingress-nginx controller stops working after upgrading Kubernetes to 1.22 or later
ingress-nginx controller does not start after an AKS upgrade to 1.22
Kubernetes 1.22 stopped serving the extensions/v1beta1 and networking.k8s.io/v1beta1 Ingress APIs.
2 causes, each with a fixServers
Status code 460 on an AWS Application Load Balancer
elb_status_code 460 in ALB access logs
A 460 is generated by the load balancer, not by your app.
3 causes, each with a fixServers
Application Load Balancer returns 504 for requests to EC2 instances
HTTPCode_ELB_504_Count
A 504 from an Application Load Balancer means it could not get an answer from a target in time.
4 causes, each with a fix