Skip to content

Fix MTLS configuration in spring boot autoconfiguration#1441

Merged
Spikhalskiy merged 4 commits intotemporalio:masterfrom
yassineb:fix-mtls-configuration
Sep 16, 2022
Merged

Fix MTLS configuration in spring boot autoconfiguration#1441
Spikhalskiy merged 4 commits intotemporalio:masterfrom
yassineb:fix-mtls-configuration

Conversation

@yassineb
Copy link
Copy Markdown
Contributor

@yassineb yassineb commented Sep 16, 2022

What was changed

  • Added tests to ensure ServiceStubs is loaded properly.
  • Moved applying MTLS properties and building SSLContext to within the try-with-resource block.

Why?

MTLS configuration fails to load certificates due to input stream already closed. The read from the stream happens within the SSLContextBuilder::build method (specifically when calling sslContextBuilder.keyManager) which is outside the try-with-resource.

@@ -0,0 +1,28 @@
-----BEGIN CERTIFICATE-----
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Spikhalskiy I copied the certs from temporal-serviceclient. I noticed the certificate is expiring at the end of the year, we should probably update them to avoid unit tests failing in a few months.

@Spikhalskiy
Copy link
Copy Markdown
Contributor

Thank you for the contribution! This looks great.

@Spikhalskiy Spikhalskiy merged commit 4759205 into temporalio:master Sep 16, 2022
@yassineb yassineb deleted the fix-mtls-configuration branch September 16, 2022 17:07
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.

2 participants