Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test): wrong url used in expired certificate test #242

Merged
merged 4 commits into from
May 29, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions transport/tls/stream_dialer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ func TestUntrustedRoot(t *testing.T) {
require.ErrorAs(t, err, &certErr)
}

func TestRevoked(t *testing.T) {
func TestExpired(t *testing.T) {
sd, err := NewStreamDialer(&transport.TCPDialer{})
require.NoError(t, err)
_, err = sd.DialStream(context.Background(), "revoked.badssl.com:443")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I explicitly wanted to test for revoked here. I don't think the issue is with the original test. It seems like revoked.badssl.com no longer serves an expired cert, so we don't return an error. Chrome is considering it safe.
image

Can you instead comment it out or use t.Skip("Skipping until revoked.badssl.com is fixed") in addition to adding the expired test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed offline, will keep the revoke test, but skip two platforms that won't throw errors.

_, err = sd.DialStream(context.Background(), "expired.badssl.com:443")
var certErr x509.CertificateInvalidError
require.ErrorAs(t, err, &certErr)
require.Equal(t, x509.Expired, certErr.Reason)
Expand Down
Loading