Skip to content
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

Set default value for key/trust store type as constant for JDK PKCS setup #5000

Conversation

willyborankin
Copy link
Collaborator

@willyborankin willyborankin commented Dec 30, 2024

Description

The KeyStore.getDefaultType() method returns JKS by default for all JDK versions prior to JDK 23,
which switches the default to PKCS12. Since the refactored version uses
KeyStore.getDefaultType(), it could break backward compatibility with older JDK versions.

JDK 21 docs vs JDK23 docs

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

Check List

  • New functionality includes testing
  • New functionality has been documented
  • New Roles/Permissions have a corresponding security dashboards plugin PR
  • API changes companion pull request created
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@willyborankin willyborankin force-pushed the fix-ssl-config-default-keystore-type branch 3 times, most recently from fb6a187 to b8a8c94 Compare December 30, 2024 19:43
@willyborankin willyborankin marked this pull request as ready for review December 30, 2024 19:52
@willyborankin willyborankin added the backport 2.x backport to 2.x branch label Dec 30, 2024
Copy link

codecov bot commented Dec 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.40%. Comparing base (a3345ef) to head (d26846a).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5000      +/-   ##
==========================================
- Coverage   71.50%   71.40%   -0.11%     
==========================================
  Files         334      334              
  Lines       22556    22556              
  Branches     3589     3589              
==========================================
- Hits        16129    16105      -24     
- Misses       4635     4661      +26     
+ Partials     1792     1790       -2     
Files with missing lines Coverage Δ
...rch/security/ssl/config/SslCertificatesLoader.java 88.67% <100.00%> (ø)
...ensearch/security/ssl/util/SSLConfigConstants.java 79.16% <ø> (ø)

... and 5 files with indirect coverage changes

The KeyStore.getDefaultType() method
returns JKS by default for all JDK versions
prior to JDK 23,
which switches the default to PKCS12.
Since the refactored version uses
KeyStore.getDefaultType(), it could break backward compatibility with older JDK versions.

Signed-off-by: Andrey Pleskach <[email protected]>
@willyborankin willyborankin force-pushed the fix-ssl-config-default-keystore-type branch from b8a8c94 to d26846a Compare December 30, 2024 20:21
@willyborankin willyborankin changed the title Fix default key store type for JDK PKCS setup Set default value for key/trust store type as constant for JDK PKCS setup Dec 30, 2024
Copy link
Member

@cwperks cwperks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @willyborankin. This ensures that its consistent with the documentation: https://opensearch.org/docs/latest/security/configuration/tls/

@cwperks cwperks merged commit e83db44 into opensearch-project:main Jan 2, 2025
41 of 42 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 2, 2025
…etup (#5000)

Signed-off-by: Andrey Pleskach <[email protected]>
(cherry picked from commit e83db44)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants