Skip to content

Commit f244f71

Browse files
authored
Add info on TLS renegotiation and limits
1 parent dd93c56 commit f244f71

File tree

1 file changed

+29
-9
lines changed

1 file changed

+29
-9
lines changed

articles/app-service/app-service-web-configure-tls-mutual-auth.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,28 @@ You can restrict access to your Azure App Service app by enabling different type
2222
[!INCLUDE [Prepare your web app](../../includes/app-service-ssl-prepare-app.md)]
2323

2424
## Enable client certificates
25-
26-
To set up your app to require client certificates:
27-
28-
1. From the left navigation of your app's management page, select **Configuration** > **General Settings**.
29-
30-
1. Select **Client certificate mode** of choice. Select **Save** at the top of the page.
25+
When you enable client certificate for your app, you should select your choice of client certificate mode. Each mode defines how your app will handle incoming client certificates:
3126

3227
|Client certificate modes|Description|
3328
|-|-|
3429
|Required|All requests require a client certificate.|
3530
|Optional|Requests may or may not use a client certificate. Clients will be prompted for a certificate by default. For example, browser clients will show a prompt to select a certificate for authentication.|
3631
|Optional Interactive User|Requests may or may not use a client certificate. Clients will not be prompted for a certificate by default. For example, browser clients will not show a prompt to select a certificate for authentication.|
3732

33+
### [Azure portal](#tab/azureportal)
34+
To set up your app to require client certificates in Azure portal:
35+
1. Navigate to your app's management page.
36+
1. From the left navigation of your app's management page, select **Configuration** > **General Settings**.
37+
1. Select **Client certificate mode** of choice. Select **Save** at the top of the page.
38+
3839
### [Azure CLI](#tab/azurecli)
39-
To do the same with Azure CLI, run the following command in the [Cloud Shell](https://shell.azure.com):
40+
With Azure CLI, run the following command in the [Cloud Shell](https://shell.azure.com):
4041

4142
```azurecli-interactive
4243
az webapp update --set clientCertEnabled=true --name <app-name> --resource-group <group-name>
4344
```
44-
### [Bicep](#tab/bicep)
4545

46+
### [Bicep](#tab/bicep)
4647
For Bicep, modify the properties `clientCertEnabled`, `clientCertMode`, and `clientCertExclusionPaths`. A sample Bicep snippet is provided for you:
4748

4849
```bicep
@@ -63,7 +64,6 @@ resource appService 'Microsoft.Web/sites@2020-06-01' = {
6364
```
6465

6566
### [ARM template](#tab/arm)
66-
6767
For ARM templates, modify the properties `clientCertEnabled`, `clientCertMode`, and `clientCertExclusionPaths`. A sample ARM template snippet is provided for you:
6868

6969
```ARM
@@ -113,6 +113,26 @@ For ASP.NET, the client certificate is available through the **HttpRequest.Clien
113113

114114
For other application stacks (Node.js, PHP, etc.), the client cert is available in your app through a base64 encoded value in the `X-ARR-ClientCert` request header.
115115

116+
## Client certificate limitation
117+
Certain client certificate configurations cannot support incoming requests with large files greater than 100kb. TLS renegotiation will fail any POST or PUT requests using large files with a 403 error. App Service uses TLS renegotiation to retrieve the client certificates. These configurations below will trigger TLS renegotiation:
118+
119+
1. Using client certificate mode "Optional Interactive User"
120+
2. Using client certificate exclusion paths regardless of client certificate mode
121+
122+
### Resolving large files limitation
123+
To resolve the error due to large files greater than 100kb due to TLS renegotiation, here are known alternative solutions to address the limitations:
124+
125+
#### Changing client certificate configurations
126+
Update your app's client certificate configuration to meet _all_ requirements below:
127+
1. Set client certificate mode to either "Required" or "Optional"
128+
2. Remove all client certificate exclusion paths
129+
130+
#### Sending HEAD requests
131+
Send a HEAD request before the PUT/POST request. The HEAD request will handle the client certificate.
132+
133+
### Adding "Expect:100-Continue" header
134+
Add the header `Expect: 100-Continue` to your request. This will cause the client to wait until the server responds with a `100 Continue` before sending the request body, which bypasses the buffers.
135+
116136
## ASP.NET Core sample
117137

118138
For ASP.NET Core, middleware is provided to parse forwarded certificates. Separate middleware is provided to use the forwarded protocol headers. Both must be present for forwarded certificates to be accepted. You can place custom certificate validation logic in the [CertificateAuthentication options](/aspnet/core/security/authentication/certauth).

0 commit comments

Comments
 (0)