[mTLS] Fix acme verfication when mTLS and Client CN verification is enabled (#11062)

This commit is contained in:
bossm8 2024-03-08 21:32:40 +01:00 committed by GitHub
parent f3a4f07174
commit 7d12628208
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -985,8 +985,10 @@ stream {
{{ if not ( empty $server.CertificateAuth.MatchCN ) }}
{{ if gt (len $server.CertificateAuth.MatchCN) 0 }}
if ( $ssl_client_s_dn !~ {{ $server.CertificateAuth.MatchCN }} ) {
return 403 "client certificate unauthorized";
location ~ ^/(?!(\.well-known/acme-challenge)) {
if ( $ssl_client_s_dn !~ {{ $server.CertificateAuth.MatchCN }} ) {
return 403 "client certificate unauthorized";
}
}
{{ end }}
{{ end }}