@@ -2398,23 +2398,22 @@ func TestTLSConfigAllowIncompatibleKeyUsage(t *testing.T) {
23982398 tlsCfg .RootCAs = caPool
23992399 client := & http.Client {Transport : & http.Transport {TLSClientConfig : tlsCfg }}
24002400 _ , err = client .Get (addr )
2401- require .Error (t , err , "expected EKU error without AllowIncompatibleKeyUsage" )
2401+ require .Errorf (t , err , "expected EKU error without AllowIncompatibleKeyUsage" )
24022402 require .Contains (t , err .Error (), "incompatible key usage" )
24032403 })
24042404
24052405 t .Run ("with AllowIncompatibleKeyUsage succeeds" , func (t * testing.T ) {
24062406 cfg := TLSConfig {
24072407 AllowIncompatibleKeyUsage : true ,
2408- // ServerName override for IP-addressed connection.
24092408 }
24102409 tlsCfg , err := NewTLSConfig (& cfg )
24112410 require .NoError (t , err )
2412- require .True (t , tlsCfg .InsecureSkipVerify , "InsecureSkipVerify should be true internally" )
2413- require .NotNil (t , tlsCfg .VerifyPeerCertificate , "VerifyPeerCertificate should be set" )
2411+ require .Truef (t , tlsCfg .InsecureSkipVerify , "InsecureSkipVerify should be true internally" )
2412+ require .NotNilf (t , tlsCfg .VerifyPeerCertificate , "VerifyPeerCertificate should be set" )
24142413 tlsCfg .RootCAs = caPool
24152414 client := & http.Client {Transport : & http.Transport {TLSClientConfig : tlsCfg }}
24162415 resp , err := client .Get (addr )
2417- require .NoError (t , err , "connection should succeed when AllowIncompatibleKeyUsage=true" )
2416+ require .NoErrorf (t , err , "connection should succeed when AllowIncompatibleKeyUsage=true" )
24182417 resp .Body .Close ()
24192418 })
24202419}
0 commit comments