Application Gateway SSL Termination

Understanding SSL Termination with Azure Application Gateway

Azure Application Gateway provides a fully managed service that enables you to distribute traffic to your web applications. One of its key features is SSL termination, which offloads the computationally intensive task of SSL/TLS decryption from your backend servers.

What is SSL Termination?

SSL termination, also known as SSL offloading, is the process where the SSL/TLS connection is decrypted at a point before it reaches the backend application servers. In the context of Application Gateway, this means the gateway decrypts incoming HTTPS requests and forwards them as unencrypted HTTP requests to the backend pool. This simplifies certificate management and reduces the load on your application instances.

Benefits of SSL Termination

How it Works

When SSL termination is configured on Application Gateway, the following happens:

  1. A client initiates an HTTPS connection to Application Gateway.
  2. Application Gateway uses the installed SSL certificate to authenticate itself to the client and establish a secure, encrypted connection.
  3. The client sends the encrypted request to Application Gateway.
  4. Application Gateway decrypts the request.
  5. Application Gateway forwards the request to one of the backend servers. This traffic can be sent over HTTP or HTTPS, depending on your backend settings.

End-to-End SSL Encryption

For enhanced security, Application Gateway also supports end-to-end SSL encryption. In this scenario, Application Gateway decrypts the SSL traffic, then re-encrypts it using a new SSL certificate before sending it to the backend server. This requires managing certificates on both the gateway and backend servers but ensures that the entire communication path is encrypted.

Configuring SSL Termination

To configure SSL termination, you need to:

  1. Create or obtain an SSL certificate: This can be a self-signed certificate for testing or a certificate from a trusted Certificate Authority (CA).
  2. Upload the certificate to Application Gateway: You can upload `.pfx` files containing the private key.
  3. Configure a listener: Create an HTTPS listener on your Application Gateway that uses the uploaded SSL certificate.
  4. Configure HTTP settings: Set the backend protocol to HTTP for the Application Gateway to forward decrypted traffic.

Example Configuration Snippet (Conceptual Azure CLI)


az network application-gateway http-settings create \
    --resource-group MyResourceGroup \
    --gateway-name MyAppGateway \
    --name appGatewayHttpSettings \
    --port 80 \
    --protocol Http \
    --cookie-based-affinity Disabled

az network application-gateway ssl-cert create \
    --resource-group MyResourceGroup \
    --gateway-name MyAppGateway \
    --name appGatewaySslCert \
    --cert-file "path/to/your/certificate.pfx" \
    --password "your_pfx_password"

az network application-gateway listener create \
    --resource-group MyResourceGroup \
    --gateway-name MyAppGateway \
    --name appGatewayHttpsListener \
    --frontend-ip appGatewayFrontendIP \
    --frontend-port 443 \
    --protocol Https \
    --ssl-cert appGatewaySslCert
            

Considerations

By leveraging SSL termination with Azure Application Gateway, you can build more efficient, scalable, and manageable web application architectures.