-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
HTTP client does not reject untrusted certificates unless trust store is configured #4116
Comments
graemerocher
added
the
status: awaiting validation
Waiting to be validated as a real issue
label
Nov 21, 2021
Code in question: Line 132 in a6c0bae
While it seems sensible not to use the |
yawkat
added
status: next major version
The issue will be considered for the next major version
type: improvement
A minor improvement to an existing feature
and removed
status: awaiting validation
Waiting to be validated as a real issue
labels
Nov 22, 2021
yawkat
added a commit
that referenced
this issue
Nov 23, 2021
This patch enables SSL cert checking by default. The old behavior without checking can be enabled using the `insecureTrustAllCertificates` option. Fixes #4116
jameskleeh
removed
the
status: next major version
The issue will be considered for the next major version
label
Nov 23, 2021
jameskleeh
added a commit
that referenced
this issue
Nov 23, 2021
* Enable client SSL certificate checking by default This patch enables SSL cert checking by default. The old behavior without checking can be enabled using the `insecureTrustAllCertificates` option. Fixes #4116 * note on trust store config * use netty TMF setup * fix some tests, move config * more test fixes * more test fixes * breaks.adoc * spotless * Use dash case Co-authored-by: jameskleeh <[email protected]>
yawkat
added a commit
that referenced
this issue
Mar 15, 2023
This PR adds more test cases for the server side of mTLS. These came from an internal user that reported expired certs being accepted. The test cases check a normal cert, an expired cert, and an untrusted cert. The previous RequestCertificateSpec only tests the "happy path" with the valid cert. These tests will prevent issues similar to #4116. It turns out that the behavior for expired certs is correct. When a cert is directly added to the trust store (not just its CA), the JDK does not check expiry. I think we should match that behavior. Also contains a small change to SelfSignedSslBuilder to make it actually use the configured trust store. This has no security implications, it just makes the tests work.
Merged
sdelamo
pushed a commit
that referenced
this issue
Mar 15, 2023
This PR adds more test cases for the server side of mTLS. These came from an internal user that reported expired certs being accepted. The test cases check a normal cert, an expired cert, and an untrusted cert. The previous RequestCertificateSpec only tests the "happy path" with the valid cert. These tests will prevent issues similar to #4116. It turns out that the behavior for expired certs is correct. When a cert is directly added to the trust store (not just its CA), the JDK does not check expiry. I think we should match that behavior. Also contains a small change to SelfSignedSslBuilder to make it actually use the configured trust store. This has no security implications, it just makes the tests work.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to Reproduce
Expected Behaviour
An SSLException is thrown due to an unknown certificate
Actual Behaviour
The client accepts the certificate and gets a valid response
Environment Information
Example Application
Run
gradle test
and see 1 out of 3 tests fail. This may require an update to the trust store configuration inHttpSslBugTest.java
if your jdk default cacerts has been modified.The text was updated successfully, but these errors were encountered: