Skip to content

Commit abed720

Browse files
committed
renaming var in tlssetting
1 parent 414b760 commit abed720

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

cns/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ func getTLSConfigFromFile(tlsSettings localtls.TlsSettings) (*tls.Config, error)
226226
tlsConfig.ClientCAs = rootCAs
227227
tlsConfig.RootCAs = rootCAs
228228
tlsConfig.VerifyPeerCertificate = func(rawCerts [][]byte, _ [][]*x509.Certificate) error {
229-
return verifyPeerCertificate(rawCerts, tlsSettings.AllowedClientSubjectName)
229+
return verifyPeerCertificate(rawCerts, tlsSettings.MtlsClientCertSubjectName)
230230
}
231231
}
232232
logger.Debugf("TLS configured successfully from file: %+v", tlsSettings)
@@ -280,7 +280,7 @@ func getTLSConfigFromKeyVault(tlsSettings localtls.TlsSettings, errChan chan<- e
280280
tlsConfig.ClientCAs = rootCAs
281281
tlsConfig.RootCAs = rootCAs
282282
tlsConfig.VerifyPeerCertificate = func(rawCerts [][]byte, _ [][]*x509.Certificate) error {
283-
return verifyPeerCertificate(rawCerts, tlsSettings.AllowedClientSubjectName)
283+
return verifyPeerCertificate(rawCerts, tlsSettings.MtlsClientCertSubjectName)
284284
}
285285
}
286286

cns/service_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -134,21 +134,21 @@ func TestNewService(t *testing.T) {
134134
testCertFilePath := createTestCertificate(t)
135135

136136
TLSSetting := serverTLS.TlsSettings{
137-
TLSPort: "10091",
138-
TLSSubjectName: "localhost",
139-
TLSCertificatePath: testCertFilePath,
140-
UseMTLS: true,
141-
MinTLSVersion: "TLS 1.2",
142-
AllowedClientSubjectName: "example.com",
137+
TLSPort: "10091",
138+
TLSSubjectName: "localhost",
139+
TLSCertificatePath: testCertFilePath,
140+
UseMTLS: true,
141+
MinTLSVersion: "TLS 1.2",
142+
MtlsClientCertSubjectName: "example.com",
143143
}
144144

145145
TLSSettingWithDisallowedClientSN := serverTLS.TlsSettings{
146-
TLSPort: "10092",
147-
TLSSubjectName: "localhost",
148-
TLSCertificatePath: testCertFilePath,
149-
UseMTLS: true,
150-
MinTLSVersion: "TLS 1.2",
151-
AllowedClientSubjectName: "random.com",
146+
TLSPort: "10092",
147+
TLSSubjectName: "localhost",
148+
TLSCertificatePath: testCertFilePath,
149+
UseMTLS: true,
150+
MinTLSVersion: "TLS 1.2",
151+
MtlsClientCertSubjectName: "random.com",
152152
}
153153

154154
runMutualTLSTest := func(tlsSettings serverTLS.TlsSettings, handshakeFailureExpected bool) {

0 commit comments

Comments
 (0)