Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

Azure Application Gateway: intermediate certificate is missing

ErrorIntermediate certificate is missing

Short 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.

  • Applies to Azure Application Gateway v2, OpenSSL 3.0
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 -showcerts
  2. 2Match what you see, then jump to its fix

    1. 1The -showcerts output lists one certificate, or the chain stops before a root the client trusts.The listener PFX holds only the leaf certificateFix
    2. 2The 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. 3The 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

What does the error look like?

  • Intermediate certificate is missing
  • Chain is incomplete when the gateway's certificate is tested with openssl s_client or an SSL checker
  • Backend 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 -noout

2Fix

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.pfx

3Verify

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 -showcerts

Confirmed by learn.microsoft.com

Did this fix it?

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 -showcerts

2Fix

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.cer

3Verify

Backend health turns Healthy.

# Application Gateway > Monitoring > Backend health

Confirmed by learn.microsoft.com

Did this fix it?

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 subjectAltName

2Fix

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.com

3Verify

Backend health turns Healthy, and the site loads over HTTPS.

curl -I https://gateway.example.com/

Confirmed by learn.microsoft.com

Did this fix it?

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

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 fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.