Skip to content

Auto generate test PEM files at runtime using BouncyCastle#6827

Merged
dlvenable merged 6 commits intoopensearch-project:mainfrom
srikanthpadakanti:auto-generate-pem-6826
May 7, 2026
Merged

Auto generate test PEM files at runtime using BouncyCastle#6827
dlvenable merged 6 commits intoopensearch-project:mainfrom
srikanthpadakanti:auto-generate-pem-6826

Conversation

@srikanthpadakanti
Copy link
Copy Markdown
Contributor

Description

Replace static PEM test files with runtime generated certificates using BouncyCastle for the OpenSearch sink mTLS tests. The test CA is now generated with proper BasicConstraints and KeyUsage extensions. Added edge case tests for wrong CA rejection and inline PEM content support.

Issues Resolved

Resolves #6826
#6826

Check List

  • [ X ] New functionality includes testing.
  • New functionality has a documentation issue. Please link to it in this PR.
  • [ X ] New functionality has javadoc added
  • [ X ] Commits are signed with a real name per the DCO

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.

Copy link
Copy Markdown
Member

@dlvenable dlvenable left a comment

Choose a reason for hiding this comment

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

Signed-off-by: Srikanth Padakanti <srikanth_padakanti@apple.com>
@srikanthpadakanti srikanthpadakanti force-pushed the auto-generate-pem-6826 branch from df7695d to 09f2d39 Compare May 7, 2026 00:31
The connectionConfiguration local variable was moved out of
doInitializeInternal scope by PR opensearch-project#6795. Use the getter from
openSearchSinkConfig instead.

Signed-off-by: Srikanth Padakanti <srikanth_padakanti@apple.com>
Replace File.deleteOnExit() with JUnit @tempdir so generated PEM
files are cleaned up reliably by the test framework.

Signed-off-by: Srikanth Padakanti <srikanth_padakanti@apple.com>
The verification RestClient also needs to present a client certificate
when OpenSearch has clientauth_mode: REQUIRE. Added a local client
builder with client cert support. Also simplified the workflow mTLS
config logic with prefix detection.

Signed-off-by: Srikanth Padakanti <srikanth_padakanti@apple.com>
@srikanthpadakanti
Copy link
Copy Markdown
Contributor Author

srikanthpadakanti commented May 7, 2026

@dlvenable AWS secrets test is unrelated to this change.

main has a compile error in OpenSearchSink.java where #6771 references a constructor-local variable from doInitializeInternal() after #6795 refactored it out of scope.

…refactor"

This reverts commit e96d89d.

Signed-off-by: Srikanth Padakanti <srikanth_padakanti@apple.com>
@dlvenable dlvenable merged commit 5f9851b into opensearch-project:main May 7, 2026
7 of 100 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto-generate test PEM files at runtime for OpenSearch sink mTLS tests

2 participants