Skip to content

Commit

Permalink
fixed: handle tls.CertificateVerificationError
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine Mercadal committed Feb 17, 2023
1 parent 61fc46f commit 5f8c83a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion maniphttp/manipulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ func (s *httpManipulator) send(

goto RETRY

case x509.UnknownAuthorityError, x509.CertificateInvalidError, x509.HostnameError:
case x509.UnknownAuthorityError, x509.CertificateInvalidError, x509.HostnameError, x509.InsecureAlgorithmError, *tls.CertificateVerificationError:
return nil, manipulate.ErrTLS{Err: err}

default:
Expand Down
2 changes: 1 addition & 1 deletion maniphttp/manipulator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,7 @@ func TestHTTP_send(t *testing.T) {

So(err, ShouldNotBeNil)
So(err, ShouldHaveSameTypeAs, manipulate.ErrTLS{})
So(err.Error(), ShouldEqual, fmt.Sprintf(`TLS error: Post "%s": x509: certificate signed by unknown authority`, ts.URL))
So(err.Error(), ShouldEqual, fmt.Sprintf(`TLS error: Post "%s": tls: failed to verify certificate: x509: certificate signed by unknown authority`, ts.URL))

So(resp, ShouldBeNil)
})
Expand Down

0 comments on commit 5f8c83a

Please sign in to comment.