@@ -8,14 +8,12 @@ func TestClientTLSConfig(t *testing.T) {
8
8
derfmt := CertKeyFormatDER
9
9
pemfmt := CertKeyFormatPEM
10
10
pfxfmt := CertKeyFormatPKCS12
11
- testTLSConfig (t , false , "tls/ca.crt" , pemfmt , "tls/client.crt" , pemfmt , "tls/client.key" , pemfmt , "" )
12
- testTLSConfig (t , false , "tls/ca.crt" , pemfmt , "tls/client.der" , derfmt , "tls/client.key" , pemfmt , "" )
13
- testTLSConfig (t , false , "tls/ca.crt" , pemfmt , "tls/client.pfx" , pfxfmt , "tls/client.key" , pemfmt , "" )
14
- testTLSConfig (t , false , "tls/ca.crt" , pemfmt , "tls/client_pass.pfx" , pfxfmt , "" , pemfmt , "pfxpassword" )
15
- testTLSConfig (t , false , "tls/ca.der" , derfmt , "tls/client.pfx" , pfxfmt , "" , pemfmt , "" )
16
- //testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/client.crt", pemfmt, "tls/client.key.pass", pemfmt, "123456") // not support
17
- //testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/client_pass.pfx", pfxfmt, "", pemfmt, "invalidpwd") // invalid
18
- //testTLSConfig(t, false, "tls/ca.crt", pemfmt, "tls/client.der", derfmt, "tls/client.key.der", derfmt, "") key can not be der
11
+ testTLSConfig (t , false , "../../testing/tls/ca.crt" , pemfmt , "../../testing/tls/client.crt" , pemfmt , "../../testing/tls/client.key" , pemfmt , "" )
12
+ testTLSConfig (t , false , "../../testing/tls/ca.crt" , pemfmt , "../../testing/tls/client.der" , derfmt , "../../testing/tls/client.key" , pemfmt , "" )
13
+ testTLSConfig (t , false , "../../testing/tls/ca.crt" , pemfmt , "../../testing/tls/client.pfx" , pfxfmt , "../../testing/tls/client.key" , pemfmt , "" )
14
+ testTLSConfig (t , false , "../../testing/tls/ca.crt" , pemfmt , "../../testing/tls/client_pass.pfx" , pfxfmt , "" , pemfmt , "pfxpassword" )
15
+ testTLSConfig (t , false , "../../testing/tls/ca.der" , derfmt , "../../testing/tls/client.pfx" , pfxfmt , "" , pemfmt , "" )
16
+ testTLSConfig (t , false , "../../testing/tls/ca.crt" , pemfmt , "../../testing/tls/testcert.pem" , pemfmt , "../../testing/tls/testkey.pem" , pemfmt , "" )
19
17
}
20
18
21
19
func testTLSConfig (
@@ -40,12 +38,12 @@ func testTLSConfig(
40
38
}
41
39
42
40
func TestGuessFormat (t * testing.T ) {
43
- guessFormat (t , "tls/client.crt" , CertKeyFormatPEM )
44
- guessFormat (t , "tls/client.cer" , CertKeyFormatPEM )
45
- guessFormat (t , "tls/client.key" , CertKeyFormatPEM )
46
- guessFormat (t , "tls/client.pfx" , CertKeyFormatPKCS12 )
47
- guessFormat (t , "tls/client.der" , CertKeyFormatDER )
48
- forceFormat (t , "tls/client.guess" , CertKeyFormatPEM , CertKeyFormatPEM )
41
+ guessFormat (t , "../../testing/ tls/client.crt" , CertKeyFormatPEM )
42
+ guessFormat (t , "../../testing/ tls/client.cer" , CertKeyFormatPEM )
43
+ guessFormat (t , "../../testing/ tls/client.key" , CertKeyFormatPEM )
44
+ guessFormat (t , "../../testing/ tls/client.pfx" , CertKeyFormatPKCS12 )
45
+ guessFormat (t , "../../testing/ tls/client.der" , CertKeyFormatDER )
46
+ forceFormat (t , "../../testing/ tls/client.guess" , CertKeyFormatPEM , CertKeyFormatPEM )
49
47
}
50
48
51
49
func guessFormat (t * testing.T , filename string , formatExpected CertificateKeyFormat ) {
0 commit comments