@@ -8,14 +8,12 @@ func TestClientTLSConfig(t *testing.T) {
88 derfmt := CertKeyFormatDER
99 pemfmt := CertKeyFormatPEM
1010 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 , "" )
1917}
2018
2119func testTLSConfig (
@@ -40,12 +38,12 @@ func testTLSConfig(
4038}
4139
4240func 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 )
4947}
5048
5149func guessFormat (t * testing.T , filename string , formatExpected CertificateKeyFormat ) {
0 commit comments