feat: HTTPS support#91
Merged
Merged
Conversation
Adds a 1024-bit RSA fixture and PemSslContextTest case that exercises the minimum-strength guard, lifting new-code coverage on PR 91 above the 80% Sonar gate. Splits the nested ternary in OpenApiServer.Builder into a resolvePort() helper to clear the matching SonarLint finding.
Extracts the nested try in decodeCertificateChain into a helper, chains the RSA InvalidKeySpecException as suppressed when the EC fallback also fails, drops the unused PrivateKey parameter on requireMinimumStrength, names the 2048/256-bit floors and the 8-byte signature probe as constants, and removes redundant `throws Exception` declarations on tests that don't throw.
Reorders the strength check before the signature check so a sub-spec EC key fails fast on bit count (192 < 256) instead of tripping the matching-signature probe. Adds P-192 EC and DSA fixtures, plus tests covering the weak EC throw, the "Unsupported TLS private key algorithm" branch (DSA key with RSA cert), and the "Unsupported TLS public key algorithm" branch (DSA cert with RSA key). Simplifies the algorithm switch in verifyKeyMatchesCert now that decodePrivateKey guarantees RSA or EC keys. Lifts PemSslContext line coverage from ~77% to 86%. Remaining uncovered lines are defensive GeneralSecurityException / IOException catches around JDK crypto APIs that do not throw for valid inputs.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



No description provided.