Skip to content

Conversation

@mhalbritter
Copy link
Contributor

@mhalbritter mhalbritter commented Oct 10, 2023

Implements reloading of SSL bundles. Netty and Tomcat react to SSL bundle reload and hot-reload their SSL certificates (existing connections use the old key material, new connections use the new material).

Implemented a FileWatcher based on java.nio to watch for file changes.

Adds new properties to JKS and PEM bundles to control reload. If reload is enabled, the keystore / key files / certificate files are automatically watched and reload the SSL bundle if they change (which in turn will trigger reload of SSL in tomcat / netty).

I had to refactor the PemContent class a bit, because we now need to know at 2 places if the PEM SSL bundle configuration points is a URL or PEM content.

@mhalbritter mhalbritter added type: enhancement A general enhancement status: waiting-for-triage An issue we've not yet triaged labels Oct 10, 2023
@mhalbritter mhalbritter added this to the 3.2.x milestone Oct 10, 2023
nativeBuildToolsVersion=0.9.27
springFrameworkVersion=6.1.0-SNAPSHOT
tomcatVersion=10.1.13
tomcatVersion=10.1.14
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This breaks some tests, which I haven't fixed in this PR. I had to upgrade the Tomcat version to be able to call protocol.addSslHostConfig(sslHostConfig, true);

@mhalbritter mhalbritter force-pushed the mh/37131-investigate-hot-reloading-of-tls-certificates-for-embedded-web-servers branch from c9e4595 to 438781e Compare October 12, 2023 11:22
@mhalbritter
Copy link
Contributor Author

@philwebb did a pass over the code, I force pushed this PR with his changes. Besides the Tomcat upgrade which breaks some tests this is ready to merge.

@mhalbritter mhalbritter added status: blocked An issue that's blocked on an external project change and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 12, 2023
@wilkinsona wilkinsona removed the status: blocked An issue that's blocked on an external project change label Oct 16, 2023
@wilkinsona wilkinsona modified the milestones: 3.2.x, 3.2.0-RC1 Oct 16, 2023
wilkinsona added a commit that referenced this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants