Add OpenSSL 3.x support to openssl-dynamic #867
Merged
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
openssl-dynamic
module only compiles against OpenSSL 1.x.Modifications:
The most significant change is that one no longer needs to provide DH parameters manually. By calling
SSL_CTX_set_dh_auto()
, OpenSSL will use the built-in parameters that match the key pair size. E.g. RSA 2048 will use DH 2048 and so on.The property
jdk.tls.ephemeralDHKeySize
, which was used to affect the size of the DH parameters before, will be ignored when using the dynamically linked OpenSSL. Instead, the system OpenSSL library's config will be used.Another change is how FIPS is managed because OpenSSL 3 introduces a "Provider" concept. The
FIPS_mode_set
is removed and is now replaced withEVP_default_properties_enable_fips
which instructs OpenSSL to load the FIPS compliant provider, if no provider is explicitly requested.Result:
The
openssl-dynamic
module can now successfully compile and run with OpenSSL 3.x.This only makes the necessary changes to the code. There is still the question of how this should be published(if at all?) since it has to be a separate artifact from the 1.x version. Some alternatives I see are
openssl3-dynamic
module.