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

Demonstrate an issue with a cert rewritten by SSL inspection. #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 15 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,21 @@ pub fn netflix() {
);
}

#[test]
pub fn rewritten_cert() {
// This cert is a rewritten version of github.com's end entity cert, generated by an
// SSL inspection system (https://www.forcepoint.com/product/ngfw-next-generation-firewall).
// We believe the cert should be considered valid:
// - It can be parsed by OpenSSL, e.g., these both work:
// `openssl x509 -inform der -in tests/rewritten_cert.der -text -noout`
// `openssl asn1parse -i -inform der -in tests/rewritten_cert.der`
// - It's generated by a robust real-world system that works in practice...
// We encountered an issue where rustls cannot handle this rewritten cert. We traced this
// back to webpki, and specifically to the code exercised by this test.
let ee: &[u8] = include_bytes!("rewritten_cert.der");
webpki::EndEntityCert::try_from(ee).unwrap();
}

#[test]
pub fn ed25519() {
let ee: &[u8] = include_bytes!("ed25519/ee.der");
Expand Down
Binary file added tests/rewritten_cert.der
Binary file not shown.