Skip to content

Commit daa7a5d

Browse files
Merge pull request #286918 from JackStromberg/patch-974499
Add secret creation and rename names to proper references
2 parents eb5dab0 + 019d25b commit daa7a5d

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

articles/application-gateway/for-containers/how-to-frontend-mtls-gateway-api.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: greglin
66
ms.service: azure-application-gateway
77
ms.subservice: appgw-for-containers
88
ms.topic: how-to
9-
ms.date: 9/16/2024
9+
ms.date: 9/17/2024
1010
ms.author: greglin
1111
---
1212

@@ -28,7 +28,7 @@ See the following figure:
2828

2929
The valid client certificate flow shows a client presenting a certificate to the frontend of Application Gateway for Containers. Application Gateway for Containers determines the certificate is valid and proxies the request to the backend target. The response is ultimately returned to the client.
3030

31-
The revoked client certificate flow shows a client presenting a revoked certificate to the frontend of Application Gateway for Containers. Application Gateway for Containers determines the certificate is not valid and prevents the request from being proxied to the client. The client will receive an HTTP 400 bad request and corresponding reason.
31+
The revoked client certificate flow shows a client presenting a revoked certificate to the frontend of Application Gateway for Containers. Application Gateway for Containers determines the certificate isn't valid and prevents the request from being proxied to the client. The client will receive an HTTP 400 bad request and corresponding reason.
3232

3333
## Prerequisites
3434

@@ -51,7 +51,7 @@ The revoked client certificate flow shows a client presenting a revoked certific
5151

5252
### Generate certificate(s)
5353

54-
For this example, we will create a root certificate and issue a client certificate from the root. If you already have a root certificate and client certificate, you may skip these steps.
54+
For this example, we'll create a root certificate and issue a client certificate from the root. If you already have a root certificate and client certificate, you may skip these steps.
5555

5656
#### Generate a private key for the root certificate
5757

@@ -103,7 +103,7 @@ spec:
103103
certificateRefs:
104104
- kind : Secret
105105
group: ""
106-
name: contoso.com
106+
name: listener-tls-secret
107107
EOF
108108
```
109109

@@ -147,7 +147,7 @@ EOF
147147
certificateRefs:
148148
- kind : Secret
149149
group: ""
150-
name: contoso.com
150+
name: listener-tls-secret
151151
addresses:
152152
- type: alb.networking.azure.io/alb-frontend
153153
value: $FRONTEND_NAME
@@ -223,8 +223,8 @@ spec:
223223
- name: gateway-01
224224
rules:
225225
- backendRefs:
226-
- name: mtls-app
227-
port: 443
226+
- name: echo
227+
port: 80
228228
EOF
229229
```
230230

@@ -266,6 +266,12 @@ status:
266266
namespace: test-infra
267267
```
268268

269+
Create a Kubernetes secret using kubectl that contains the certificate chain to the client certificate.
270+
271+
```bash
272+
kubectl create secret generic ca.bundle -n test-infra --from-file=ca.crt=root.crt
273+
```
274+
269275
Create a FrontendTLSPolicy
270276

271277
```bash
@@ -290,7 +296,6 @@ spec:
290296
group: ""
291297
kind: Secret
292298
namespace: test-infra
293-
subjectAltName: "contoso-client"
294299
EOF
295300
```
296301

@@ -321,10 +326,23 @@ Now we're ready to send some traffic to our sample application, via the FQDN ass
321326
fqdn=$(kubectl get gateway gateway-01 -n test-infra -o jsonpath='{.status.addresses[0].value}')
322327
```
323328
324-
Curling this FQDN should return responses from the backend as configured on the HTTPRoute.
329+
Curling the FQDN of your frontend without the client certificate.
330+
331+
```bash
332+
curl --insecure https://$fqdn/```
333+
334+
Note the response alerts a certificate is required.
335+
336+
```
337+
curl: (56) OpenSSL SSL_read: OpenSSL/1.1.1k: error:1409445C:SSL routines:ssl3_read_bytes:tlsv13 alert certificate required, errno 0
338+
```
339+
340+
Curl the FQDN presenting the client certificate generated.
325341
326342
```bash
327343
curl --cert client.crt --key client.key --insecure https://$fqdn/
328344
```
329345
330-
Congratulations, you have installed ALB Controller, deployed a backend application, authenticated via client certificate, and routed traffic to the application via the gateway on Application Gateway for Containers.
346+
Note the response is from the backend service behind Application Gateway for Containers.
347+
348+
Congratulations, you installed ALB Controller, deployed a backend application, authenticated via client certificate, and returned traffic from your backend service via Application Gateway for Containers.

0 commit comments

Comments
 (0)