-
Notifications
You must be signed in to change notification settings - Fork 40.9k
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
Implement SSL bundle reload #37808
Implement SSL bundle reload #37808
Conversation
@@ -7,6 +7,6 @@ org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8 | |||
kotlinVersion=1.9.10 | |||
nativeBuildToolsVersion=0.9.27 | |||
springFrameworkVersion=6.1.0-SNAPSHOT | |||
tomcatVersion=10.1.13 | |||
tomcatVersion=10.1.14 |
There was a problem hiding this comment.
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);
...boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/ssl/FileWatcher.java
Outdated
Show resolved
Hide resolved
...configure/src/main/java/org/springframework/boot/autoconfigure/ssl/SslAutoConfiguration.java
Show resolved
Hide resolved
c9e4595
to
438781e
Compare
@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. |
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.