Fix regression in SslContext private key loading#12743
Merged
normanmaurer merged 1 commit intonetty:4.1from Aug 27, 2022
Merged
Fix regression in SslContext private key loading#12743normanmaurer merged 1 commit intonetty:4.1from
normanmaurer merged 1 commit intonetty:4.1from
Conversation
Motivation: The BouncyCastlePemReader checked that the bcprov dependency was available, but not the bcpkix dependency, which is also required to use the Bouncy Castle PEM reader. This means SslContext could be tricked into using Bouncy Castle for PEM reading, when the required classes were not actually available. Modification: Add another check for bcpkix, and avoid using Bouncy Castle for PEM reading if its PEMReader is not available. Result: We no longer get the following exception: ``` java.lang.NoClassDefFoundError: org/bouncycastle/openssl/PEMParser at io.netty.handler.ssl.BouncyCastlePemReader.newParser(BouncyCastlePemReader.java:203) at io.netty.handler.ssl.BouncyCastlePemReader.getPrivateKey(BouncyCastlePemReader.java:134) at io.netty.handler.ssl.SslContext.toPrivateKey(SslContext.java:1126) ```
normanmaurer
approved these changes
Aug 27, 2022
normanmaurer
pushed a commit
that referenced
this pull request
Aug 27, 2022
Motivation: The BouncyCastlePemReader checked that the bcprov dependency was available, but not the bcpkix dependency, which is also required to use the Bouncy Castle PEM reader. This means SslContext could be tricked into using Bouncy Castle for PEM reading, when the required classes were not actually available. Modification: Add another check for bcpkix, and avoid using Bouncy Castle for PEM reading if its PEMReader is not available. Result: We no longer get the following exception: ``` java.lang.NoClassDefFoundError: org/bouncycastle/openssl/PEMParser at io.netty.handler.ssl.BouncyCastlePemReader.newParser(BouncyCastlePemReader.java:203) at io.netty.handler.ssl.BouncyCastlePemReader.getPrivateKey(BouncyCastlePemReader.java:134) at io.netty.handler.ssl.SslContext.toPrivateKey(SslContext.java:1126) ```
Scottmitch
added a commit
to Scottmitch/servicetalk-1
that referenced
this pull request
Aug 30, 2022
This reverts commit a0c8d61. We anticipate another release before updating Netty versions, and there is a Netty issue that may impact ServiceTalk users: netty/netty#12743.
Scottmitch
added a commit
to apple/servicetalk
that referenced
this pull request
Aug 30, 2022
This reverts commit a0c8d61. We anticipate another release before updating Netty versions, and there is a Netty issue that may impact ServiceTalk users: netty/netty#12743.
This was referenced Sep 6, 2022
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.
Motivation:
The BouncyCastlePemReader checked that the bcprov dependency was available, but not the bcpkix dependency, which is also required to use the Bouncy Castle PEM reader.
This means SslContext could be tricked into using Bouncy Castle for PEM reading, when the required classes were not actually available.
Modification:
Add another check for bcpkix, and avoid using Bouncy Castle for PEM reading if its PEMReader is not available.
Result:
We no longer get the following exception: