You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/app-service/app-service-web-configure-tls-mutual-auth.md
+29-9Lines changed: 29 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,27 +22,28 @@ You can restrict access to your Azure App Service app by enabling different type
22
22
[!INCLUDE [Prepare your web app](../../includes/app-service-ssl-prepare-app.md)]
23
23
24
24
## 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:
31
26
32
27
|Client certificate modes|Description|
33
28
|-|-|
34
29
|Required|All requests require a client certificate.|
35
30
|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.|
36
31
|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.|
37
32
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
+
38
39
### [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):
40
41
41
42
```azurecli-interactive
42
43
az webapp update --set clientCertEnabled=true --name <app-name> --resource-group <group-name>
43
44
```
44
-
### [Bicep](#tab/bicep)
45
45
46
+
### [Bicep](#tab/bicep)
46
47
For Bicep, modify the properties `clientCertEnabled`, `clientCertMode`, and `clientCertExclusionPaths`. A sample Bicep snippet is provided for you:
For ARM templates, modify the properties `clientCertEnabled`, `clientCertMode`, and `clientCertExclusionPaths`. A sample ARM template snippet is provided for you:
68
68
69
69
```ARM
@@ -113,6 +113,26 @@ For ASP.NET, the client certificate is available through the **HttpRequest.Clien
113
113
114
114
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.
115
115
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
+
116
136
## ASP.NET Core sample
117
137
118
138
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