@@ -18,7 +18,7 @@ import (
18
18
)
19
19
20
20
func NewTlsConfig (settings * configuration.Settings ) (* tls.Config , error ) {
21
- logrus .Debugf ("Creating TLS config for mode: '%s'" , settings .TlsMode )
21
+ logrus .Debugf ("authentication::NewTlsConfig Creating TLS config for mode: '%s'" , settings .TlsMode )
22
22
switch settings .TlsMode {
23
23
case "ss-tls" : // needs ca cert
24
24
return buildSelfSignedTlsConfig (settings .Certificates )
@@ -38,7 +38,7 @@ func NewTlsConfig(settings *configuration.Settings) (*tls.Config, error) {
38
38
}
39
39
40
40
func buildSelfSignedTlsConfig (certificates * certification.Certificates ) (* tls.Config , error ) {
41
- logrus .Debug ( " Building self-signed TLS config" )
41
+ logrus .Debugf ( "authentication::buildSelfSignedTlsConfig Building self-signed TLS config, CA Secret Key(%v)" , certificates . CaCertificateSecretKey )
42
42
certPool , err := buildCaCertificatePool (certificates .GetCACertificate ())
43
43
if err != nil {
44
44
return nil , err
@@ -51,7 +51,7 @@ func buildSelfSignedTlsConfig(certificates *certification.Certificates) (*tls.Co
51
51
}
52
52
53
53
func buildSelfSignedMtlsConfig (certificates * certification.Certificates ) (* tls.Config , error ) {
54
- logrus .Debug ( " buildSelfSignedMtlsConfig Building self-signed mTLS config" )
54
+ logrus .Debugf ( "authentication:: buildSelfSignedMtlsConfig Building self-signed mTLS config, CA Secret Key(%v), Client Certificate Key(%v)" , certificates . CaCertificateSecretKey , certificates . ClientCertificateSecretKey )
55
55
certPool , err := buildCaCertificatePool (certificates .GetCACertificate ())
56
56
if err != nil {
57
57
return nil , err
@@ -72,14 +72,14 @@ func buildSelfSignedMtlsConfig(certificates *certification.Certificates) (*tls.C
72
72
}
73
73
74
74
func buildBasicTlsConfig (skipVerify bool ) * tls.Config {
75
- logrus .Debug ( "Building basic TLS config" )
75
+ logrus .Debugf ( "authentication::buildBasicTlsConfig skipVerify(%v)" , skipVerify )
76
76
return & tls.Config {
77
77
InsecureSkipVerify : skipVerify ,
78
78
}
79
79
}
80
80
81
81
func buildCaTlsConfig (certificates * certification.Certificates ) (* tls.Config , error ) {
82
- logrus .Debug ( "Building CA TLS config" )
82
+ logrus .Debugf ( "authentication::buildCaTlsConfig, Client Certificate Key(%v)" , certificates . ClientCertificateSecretKey )
83
83
certificate , err := buildCertificates (certificates .GetClientCertificate ())
84
84
if err != nil {
85
85
return nil , err
@@ -92,12 +92,12 @@ func buildCaTlsConfig(certificates *certification.Certificates) (*tls.Config, er
92
92
}
93
93
94
94
func buildCertificates (privateKeyPEM []byte , certificatePEM []byte ) (tls.Certificate , error ) {
95
- logrus .Debug ( "Building certificates" )
95
+ logrus .Debugf ( "authentication::buildCertificates, Private Key(%v), Certificate(%v)" , privateKeyPEM , certificatePEM )
96
96
return tls .X509KeyPair (certificatePEM , privateKeyPEM )
97
97
}
98
98
99
99
func buildCaCertificatePool (caCert []byte ) (* x509.CertPool , error ) {
100
- logrus .Debugf ("Building CA certificate pool" )
100
+ logrus .Debugf ("authentication::buildCaCertificatePool, CA Certificate(%v)" , caCert )
101
101
block , _ := pem .Decode (caCert )
102
102
if block == nil {
103
103
return nil , fmt .Errorf ("failed to decode PEM block containing CA certificate" )
0 commit comments