File tree 3 files changed +10
-82
lines changed
instant-ssl-reloading-with-spring-tomcat/src/main/java/nl/altindag/server/config
3 files changed +10
-82
lines changed Original file line number Diff line number Diff line change 18
18
import nl .altindag .ssl .SSLFactory ;
19
19
import org .apache .catalina .connector .Connector ;
20
20
import org .apache .coyote .http11 .AbstractHttp11Protocol ;
21
+ import org .apache .tomcat .util .net .SSLContext ;
21
22
import org .apache .tomcat .util .net .SSLHostConfig ;
22
23
import org .apache .tomcat .util .net .SSLHostConfigCertificate ;
23
24
import org .apache .tomcat .util .net .SSLHostConfigCertificate .Type ;
25
+ import org .apache .tomcat .util .net .SSLUtil ;
24
26
import org .springframework .beans .factory .annotation .Value ;
25
27
import org .springframework .boot .web .embedded .tomcat .TomcatConnectorCustomizer ;
26
28
import org .springframework .context .annotation .Configuration ;
@@ -47,7 +49,13 @@ public void customize(Connector connector) {
47
49
48
50
SSLHostConfig sslHostConfig = new SSLHostConfig ();
49
51
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 );
51
59
sslHostConfig .addCertificate (certificate );
52
60
protocol .addSslHostConfig (sslHostConfig );
53
61
}
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 64
64
<version .logcaptor>2.9.3</version .logcaptor>
65
65
<version .spring>3.3.2</version .spring>
66
66
<version .javafx>21.0.3</version .javafx>
67
- <version-tomcat >10.1.26 </version-tomcat >
67
+ <version-tomcat >10.1.40 </version-tomcat >
68
68
<version .aspectweaver>1.9.22.1</version .aspectweaver>
69
69
<version .jackson>2.17.2</version .jackson>
70
70
<version .slf4j>2.0.13</version .slf4j>
You can’t perform that action at this time.
0 commit comments