Skip to content

Commit

Permalink
use the actual hostname error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jcvrabo committed Jan 3, 2025
1 parent 1fa69c5 commit 9b249d1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 3 additions & 2 deletions api/cfnetworking/networking_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ func (*NetworkingConnection) processRequestErrors(request *http.Request, err err
URL: request.URL.String(),
}
}
if errors.As(err, &x509.HostnameError{}) {
hostnameError := x509.HostnameError{}
if errors.As(err, &hostnameError) {
return networkerror.SSLValidationHostnameError{
Message: err.Error(),
Message: hostnameError.Error(),
}
}
return networkerror.RequestError{Err: err}
Expand Down
3 changes: 0 additions & 3 deletions api/cfnetworking/networking_connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,6 @@ var _ = Describe("CF Networking Connection", func() {
When("the server does not have a verified certificate", func() {
Context("skipSSLValidation is false", func() {
BeforeEach(func() {
if runtime.GOOS == "darwin" {
Skip("ssl verification is different on darwin")
}
server.AppendHandlers(
CombineHandlers(
VerifyRequest(http.MethodGet, "/v2/foo"),
Expand Down

0 comments on commit 9b249d1

Please sign in to comment.