@@ -595,23 +595,26 @@ tuSVaQmm5eqgaAxMamBXSyw1lir07byemyuEDg0mJ1rNUGsAY8P+LWr579gvKMme
595595
596596 // Without certificate and authority, client should fail on TLS
597597 client , _ := NewClient (config )
598- res , err := client .Info ()
599- if _ , ok := err .(x509.UnknownAuthorityError ); ! ok {
600- t .Fatalf ("Uknown error, expected UnknownAuthorityError, got: %s" , err )
598+ _ , err = client .Info ()
599+
600+ if err .Error () != `x509: “instance” certificate is not standards compliant` {
601+ if _ , ok := err .(x509.UnknownAuthorityError ); ! ok {
602+ t .Fatalf ("Uknown error, expected UnknownAuthorityError, got: %s" , err )
603+ }
601604 }
602605
603- // We add the fingerprint corresponding ton testcert.LocalhostCert
606+ // We add the fingerprint corresponding to testcert.LocalhostCert
604607 //
605608 config .CertificateFingerprint = "7A3A6031CD097DA0EE84D65137912A84576B50194045B41F4F4B8AC1A98116BE"
606609 client , _ = NewClient (config )
607- res , err = client .Info ()
610+ res , err : = client .Info ()
608611 if err != nil {
609612 t .Fatal (err )
610613 }
611614 defer res .Body .Close ()
612615
613616 data , _ := ioutil .ReadAll (res .Body )
614- if bytes .Compare (data , body ) != 0 {
617+ if ! bytes .Equal (data , body ) {
615618 t .Fatalf ("unexpected payload returned: expected: %s, got: %s" , body , data )
616619 }
617620}
0 commit comments