4
votes

I'm using an Azure Application Gateway v2 to route traffic to a backendpool containing VMs running some docker container hosting an aspnet core webapi. The application is listeing in port 443. The gateway listener is configured to accept HTTPS connections. A pfx certificate has also been added. The HTTP setting of the gateway is configured as follow: enter image description here

I've provided, hopefully, the correct root certificate for the setting. I've exported the certifacte as described here: https://docs.microsoft.com/de-de/azure/application-gateway/certificates-for-backend-authentication

enter image description here

All VMs from the backend pool use the same certificate as the gateway listener. enter image description here

When calling the api using a C# application or open a specific url within a browser, the connections seems to be trusted.

enter image description here

But I get an error when calling the api using postman with endabled SSL cerificate verification. Error: unable to verify the first certificate

A check on sslhopper.com also indicates an issue within the chain. enter image description here

I got further information doing a chekc on digicert.com.

TLS Certificate is not trusted The certificate is not signed by a trusted authority (checking against Mozilla's root store). If you bought the certificate from a trusted authority, you probably just need to install one or more Intermediate certificates. Contact your certificate provider for assistance doing this for your server platform.

I'm really stuck in resolving the issue. All helpful hints are very welcome. The production environment, running on a Windows Server, wihtout the Gateway but the same certificates is valid. So the issue must be somewhere in the gateway configuration.

3

3 Answers

2
votes

The issue is resolved. The crucial clue was delivered from a blog post. http://blog.repsaj.nl/index.php/2019/08/azure-application-gateway-certificate-gotchas/ Gateway V2: the importance of the certificate chain

I did a new export of the pfx certificate including the whole chain and uploaded it to the gateway.

0
votes

If the cert is not trusted, then you need to check the Application Gateway Listener. Make sure that you are not using Basic listener.

If you are using multi-site listener, make sure that the host name which you have mentioned matches with the certificate CN

0
votes

All you need to do is to recreate the PFX by adding the intermediate certificate in it and upload to azure application gateway listeners. follow the under listed commands.

  1. openssl pkcs12 -in .pfx -clcerts -nokeys -out .crt
  2. openssl pkcs12 -in .pfx -nocerts -nodes -out .key
  3. openssl pkcs12 -export -out _new.pfx -inkey .key -in .crt -certfile intermediate.cer