File tree Expand file tree Collapse file tree 3 files changed +10
-82
lines changed
instant-ssl-reloading-with-spring-tomcat/src/main/java/nl/altindag/server/config Expand file tree Collapse file tree 3 files changed +10
-82
lines changed Original file line number Diff line number Diff line change 1818import nl .altindag .ssl .SSLFactory ;
1919import org .apache .catalina .connector .Connector ;
2020import org .apache .coyote .http11 .AbstractHttp11Protocol ;
21+ import org .apache .tomcat .util .net .SSLContext ;
2122import org .apache .tomcat .util .net .SSLHostConfig ;
2223import org .apache .tomcat .util .net .SSLHostConfigCertificate ;
2324import org .apache .tomcat .util .net .SSLHostConfigCertificate .Type ;
25+ import org .apache .tomcat .util .net .SSLUtil ;
2426import org .springframework .beans .factory .annotation .Value ;
2527import org .springframework .boot .web .embedded .tomcat .TomcatConnectorCustomizer ;
2628import org .springframework .context .annotation .Configuration ;
@@ -47,7 +49,13 @@ public void customize(Connector connector) {
4749
4850 SSLHostConfig sslHostConfig = new SSLHostConfig ();
4951 SSLHostConfigCertificate certificate = new SSLHostConfigCertificate (sslHostConfig , Type .UNDEFINED );
50- certificate .setSslContext (new TomcatSSLContext (sslFactory ));
52+ SSLContext sslContext = SSLUtil .createSSLContext (
53+ sslFactory .getSslContext (),
54+ sslFactory .getKeyManager ().orElseThrow (),
55+ sslFactory .getTrustManager ().orElseThrow ()
56+ );
57+
58+ certificate .setSslContext (sslContext );
5159 sslHostConfig .addCertificate (certificate );
5260 protocol .addSslHostConfig (sslHostConfig );
5361 }
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 6464 <version .logcaptor>2.9.3</version .logcaptor>
6565 <version .spring>3.3.2</version .spring>
6666 <version .javafx>21.0.3</version .javafx>
67- <version-tomcat >10.1.26 </version-tomcat >
67+ <version-tomcat >10.1.40 </version-tomcat >
6868 <version .aspectweaver>1.9.22.1</version .aspectweaver>
6969 <version .jackson>2.17.2</version .jackson>
7070 <version .slf4j>2.0.13</version .slf4j>
You can’t perform that action at this time.
0 commit comments