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
// Make sure the fingerprint matches a CA certificate
195
202
if!cert.IsCA {
196
-
logger.Info("Certificate matching 'ca_trusted_fingerprint' found, but is not a CA certificate")
203
+
logger.Warn("Certificate matching 'ca_trusted_fingerprint' found, but it is not a CA certificate. 'ca_trusted_fingerprint' can only be used to trust CA certificates.")
logger.Warn("no CA certificate matching the fingerprint")
216
+
// if we are here, we didn't find any CA certificate matching the fingerprint
217
+
iflen(foundCADigests) ==0 {
218
+
logger.Warn("The remote server's certificate is presented without its certificate chain. Using 'ca_trusted_fingerprint' requires that the server presents a certificate chain that includes the certificate's issuing certificate authority.")
219
+
} else {
220
+
logger.Warnf("The provided 'ca_trusted_fingerprint': '%s' does not match the fingerprint of any Certificate Authority present in the server's certificate chain. Found the following CA fingerprints instead: %v", cfg.CATrustedFingerprint, foundCADigests)
expectingWarnings: []string{"The provided 'ca_trusted_fingerprint': '"+cafingerprint+"' does not match the fingerprint of any Certificate Authority present in the server's certificate chain. Found the following CA fingerprints instead: ["+unknownAuthoritySha256+"]"},
223
+
expectedRootCAsLen: 0,
224
+
},
225
+
{
226
+
name: "Peer cert does not include a CA Certificate and is not added to cfg.RootCAs",
227
+
caTrustedFingerprint: cafingerprint,
228
+
peerCerts: []*x509.Certificate{certs["correct"]},
229
+
expectingWarnings: []string{"The remote server's certificate is presented without its certificate chain. Using 'ca_trusted_fingerprint' requires that the server presents a certificate chain that includes the certificate's issuing certificate authority."},
214
230
expectedRootCAsLen: 0,
215
231
},
232
+
{
233
+
name: "fingerprint matches peer cert instead of the CA Certificate and is not added to cfg.RootCAs",
234
+
caTrustedFingerprint: certfingerprint,
235
+
peerCerts: []*x509.Certificate{certs["correct"]},
236
+
expectingWarnings: []string{
237
+
"Certificate matching 'ca_trusted_fingerprint' found, but it is not a CA certificate. 'ca_trusted_fingerprint' can only be used to trust CA certificates.",
238
+
"The remote server's certificate is presented without its certificate chain. Using 'ca_trusted_fingerprint' requires that the server presents a certificate chain that includes the certificate's issuing certificate authority.",
0 commit comments