GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing github.com — Port 4.1: Don't use the network in the OCSP tests (#17908) (#17933) by normanmaurer · Pull Request #18038 · netty/netty Conversation
|
|
This is a port of a fix we already did in 4.2 and 5.0 but without using the new pkitesting. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Motivation: `OcspClientTest.simpleOcspQueryTest` and `OcspServerCertificateValidatorTest.connectUsingHttpAndValidateCertificateUsingOcspTest` fetch the certificate chain from `https://apple.com` and then send the OCSP query to Apple's real responder. This makes the tests flaky whenever the network is unreliable, which regularly happens on GitHub runners (for example with a `ConnectTimeoutException` to `ocsp.apple.com:80` or a failed `assertTrue(ocspStatus.get())`). Modification: - Add `OcspTestUtil` with a local Netty HTTP server on 127.0.0.1 that acts as OCSP responder. It parses the OCSP request and answers with a signed `good` response that echoes the nonce. It also contains the BouncyCastle helpers to generate the CA and server certificates with an OCSP URL that points to the local server. 4.1 has no `pkitesting` module, so `buildCertificate` accepts additional extensions. - Use it in `OcspClientTest.simpleOcspQueryTest` and enable nonce validation there. - Use it in `OcspServerCertificateValidatorTest` together with a local TLS server whose certificate points at the local OCSP responder. Result: Both tests only talk to localhost and no longer depend on external hosts.
5ae4b9c to
4076ea5
Compare
There was an error while loading. Please reload this page.
✅ All tests passed ✅🏷️ Commit: 4076ea5 Learn more about TestLens at testlens.app/docs. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
…y#17933) (netty#18038) Motivation: `OcspClientTest.simpleOcspQueryTest` and `OcspServerCertificateValidatorTest.connectUsingHttpAndValidateCertificateUsingOcspTest` fetch the certificate chain from `https://apple.com`/ and then send the OCSP query to Apple's real responder. This makes the tests flaky whenever the network is unreliable, which regularly happens on GitHub runners (for example with a `ConnectTimeoutException` to `ocsp.apple.com:80` or a failed `assertTrue(ocspStatus.get())`). Modification: - Add `OcspTestUtil` with a local Netty HTTP server on 127.0.0.1 that acts as OCSP responder. It parses the OCSP request and answers with a signed `good` response that echoes the nonce. It also contains the BouncyCastle helpers to generate the CA and server certificates with an OCSP URL that points to the local server. 4.1 has no `pkitesting` module, so `buildCertificate` accepts additional extensions. - Use it in `OcspClientTest.simpleOcspQueryTest` and enable nonce validation there. - Use it in `OcspServerCertificateValidatorTest` together with a local TLS server whose certificate points at the local OCSP responder. Result: Both tests only talk to localhost and no longer depend on external hosts.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.