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

Conversation

jyyi1
Copy link
Contributor

@jyyi1 jyyi1 commented May 28, 2024

The TestRevoked should be TestExpired because the reason x509.Expired in CertificateInvalidError stands for an expired certificate.

Revoked certificate test is tricky, because it relies on the OS implementation (e.g., macOS, Windows), the error is weakly typed and different OS will report different error messages. For now the revocation test case for Linux and Windows are skipped because the certificate revocation list is not up-to-date on these two platforms.

The failing CI is blocking all PRs including #203, #226, and #241 .

@jyyi1 jyyi1 requested a review from fortuna May 28, 2024 23:15
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.

@jyyi1 jyyi1 requested a review from fortuna May 29, 2024 19:13
@jyyi1 jyyi1 merged commit 94731fb into main May 29, 2024
6 checks passed
@jyyi1 jyyi1 deleted the junyi/fix-expired-cert-test branch May 29, 2024 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants