Skip to content

Commit

Permalink
match client tls error message on go 1.20 and newer versions
Browse files Browse the repository at this point in the history
Signed-off-by: Arne Rutjes <[email protected]>
  • Loading branch information
arner authored and adecaro committed Oct 5, 2023
1 parent 4c6d84d commit 7e0f220
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion platform/view/services/server/web/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,10 @@ var _ = Describe("Server", func() {
url := fmt.Sprintf("https://%s%s", server.Addr(), someURL)
resp, err := client.Get(url)
Expect(err).To(HaveOccurred())
Expect(err.Error()).To(ContainSubstring("remote error: tls: certificate required"))
go120message := "remote error: tls: bad certificate"
go121message := "remote error: tls: certificate required"
match := strings.Contains(err.Error(), go120message) || strings.Contains(err.Error(), go121message)
Expect(match).To(BeTrue())
Expect(resp).To(BeNil())
})
})
Expand Down

0 comments on commit 7e0f220

Please sign in to comment.