Skip to content

[9.3] (backport #431) Autorenew SSL certs and use them everywhere#447

Merged
mashhurs merged 5 commits into9.3from
mergify/bp/9.3/pr-431
Apr 20, 2026
Merged

[9.3] (backport #431) Autorenew SSL certs and use them everywhere#447
mashhurs merged 5 commits into9.3from
mergify/bp/9.3/pr-431

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented Apr 18, 2026

Background: Currently, SSL certs are static, means already generated and they have expiration date. They are used in the tests, used scopes are: unit tests, ES docker file and integration tests.

This PR:

  • introduces Autorenew SSL certs and use them everywhere like in java unit tests, docker files, ruby spec and integration tests. One caveat here is that since ES docker file needs to apply SSLs before it starts, plugin needs to create SSL certs for the ES docker file before running integrations tests.
    Places use the certificates are:

    • ES docker file (used by integration tests): ./utils/ssl-certs-generator/generate.sh shell script generates on flight;
    • specs: ./utils/ssl-certs-generator/generate.sh shell script generates
    • java unit tests: gradle generateTestCertificates generates;
      Gradle clean and generate.sh (before running) cleans up old certificates if exist.
  • upgrades junit, wiremock, mokito dependencies used by unit tests

  • Closes Generate certs at the time of when integration tests run. #425


This is an automatic backport of pull request #431 done by [Mergify](https://mergify.com).

* Autorenew SSL certs and use them everywhere: java unit tests, docker files, ruby spec and integration tests.

* Upgrades junit, wiremock, mokito dependencies used by unit tests

* Overall flow:
- to generate certs first in CI host -> run_tests.sh: used by both unit and integration tests
- generate in gradle only if needed, e.g. local ./gradlew clean test
  - we will not clean certs with gradle clean, if we do integration tests will fail due to mismatch
  - and genera.sh will skip if certs exist - makes sure we are not generating twice

(cherry picked from commit 254e669)

# Conflicts:
#	build.gradle
#	spec/integration/elastic_integration_spec.rb
@mergify
Copy link
Copy Markdown
Author

mergify Bot commented Apr 18, 2026

Cherry-pick of 254e669 has failed:

On branch mergify/bp/9.3/pr-431
Your branch is up to date with 'origin/9.3'.

You are currently cherry-picking commit 254e669.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .buildkite/scripts/run_tests.sh
	modified:   .ci/Dockerfile.elasticsearch
	modified:   .ci/logstash-run.sh
	deleted:    spec/fixtures/test_certs/README.txt
	deleted:    spec/fixtures/test_certs/ca.p12
	deleted:    spec/fixtures/test_certs/client_from_root.chain.crt
	deleted:    spec/fixtures/test_certs/client_from_root.crt
	deleted:    spec/fixtures/test_certs/client_from_root.jks
	deleted:    spec/fixtures/test_certs/client_from_root.key
	deleted:    spec/fixtures/test_certs/client_from_root.key.pkcs8
	deleted:    spec/fixtures/test_certs/client_from_root.p12
	deleted:    spec/fixtures/test_certs/client_no_matching_subject.chain.crt
	deleted:    spec/fixtures/test_certs/client_no_matching_subject.crt
	deleted:    spec/fixtures/test_certs/client_no_matching_subject.key
	deleted:    spec/fixtures/test_certs/client_no_matching_subject.key.pkcs8
	deleted:    spec/fixtures/test_certs/client_no_matching_subject.p12
	deleted:    spec/fixtures/test_certs/client_self_signed.crt
	deleted:    spec/fixtures/test_certs/client_self_signed.key
	deleted:    spec/fixtures/test_certs/client_self_signed.p12
	deleted:    spec/fixtures/test_certs/root.crt
	deleted:    spec/fixtures/test_certs/root.key
	deleted:    spec/fixtures/test_certs/server_from_root.chain.crt
	deleted:    spec/fixtures/test_certs/server_from_root.crt
	deleted:    spec/fixtures/test_certs/server_from_root.key
	deleted:    spec/fixtures/test_certs/server_from_root.key.pkcs8
	deleted:    spec/fixtures/test_certs/server_from_root.p12
	modified:   src/test/java/co/elastic/logstash/filters/elasticintegration/ElasticsearchRestClientWireMockTest.java
	renamed:    src/test/resources/co/elastic/logstash/filters/elasticintegration/ssl-test-certs/.gitignore -> utils/ssl-certs-generator/.gitignore
	renamed:    src/test/resources/co/elastic/logstash/filters/elasticintegration/ssl-test-certs/generate.sh -> utils/ssl-certs-generator/generate.sh
	renamed:    src/test/resources/co/elastic/logstash/filters/elasticintegration/ssl-test-certs/openssl.cnf -> utils/ssl-certs-generator/openssl.cnf

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   build.gradle
	both modified:   spec/integration/elastic_integration_spec.rb

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

Copy link
Copy Markdown
Collaborator

@mashhurs mashhurs left a comment

Choose a reason for hiding this comment

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

Somehow conflicted but clean backport

@mergify
Copy link
Copy Markdown
Author

mergify Bot commented Apr 20, 2026

This pull request has not been merged yet. Could you please review and merge it @mashhurs? 🙏

@elasticmachine
Copy link
Copy Markdown
Collaborator

💚 Build Succeeded

History

cc @mashhurs

@mashhurs mashhurs merged commit 7146aeb into 9.3 Apr 20, 2026
4 checks passed
@mashhurs mashhurs deleted the mergify/bp/9.3/pr-431 branch April 20, 2026 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants