Skip to content

Commit

Permalink
fix: test assertion for TestOutgoingTLSBadClientCertificate message
Browse files Browse the repository at this point in the history
  • Loading branch information
henvic committed Nov 2, 2023
1 parent d3bb0e6 commit 8ccaa9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1451,8 +1451,8 @@ func TestOutgoingTLSBadClientCertificate(t *testing.T) {
if _, err = client.Do(req); err == nil || !errors.As(err, &ue) {
t.Errorf("got: %v, expected bad certificate error message", err)
}
want := fmt.Sprintf(golden(t.Name()), ts.URL)
if got := buf.String(); got != want {
want := fmt.Sprintf(golden(t.Name()), ts.URL, strings.SplitAfter(err.Error(), "remote error: tls: ")[1])
if got := buf.String(); !strings.Contains(got, want) {
t.Errorf("logged HTTP request %s; want %s", got, want)
}
}
Expand Down
2 changes: 1 addition & 1 deletion testdata/log.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ Hello, world!
> Host: example.com
> User-Agent: Robot/0.1 crawler@example.com

* remote error: tls: bad certificate
* remote error: tls: %s
-- TestOutgoingTLSInsecureSkipVerify --
^\* Request to %s
\* Skipping TLS verification: connection is susceptible to man-in-the-middle attacks\.
Expand Down

0 comments on commit 8ccaa9c

Please sign in to comment.