Saya mencoba menggunakan SSL pada spring boot 2.2.0 dengan embeded tomcat 9.0.26 tetapi tomcat tidak dapat memuat aliran file JKS ditutup.
Berikut adalah properti aplikasi:
server.port=443
server.ssl.key-store-type=JKS
server.ssl.key-store=C:\\Keystore\\mykey.jks
server.ssl.key-store-password=cccc
server.ssl.key-alias=*.mydomain.com
Pengecualian:
org.springframework.boot.web.server.WebServerException: Tidak dapat memulai server Tomcat yang disematkan di org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start (TomcatWebServer.java.15) ~ [spring-boot-2.2.0 .BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer (ServletWebServerApplicationContext.java -.0.0 [boot -.0.297]. BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh (ServletWebServerApplicationContext.java:163 ~ ~ musim semi.barang -SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di org.springframework.context.support.AbstractApplicationContext.refresh (AbstractApplicationContext.java ,5353) ~ [spring-context-5.2.0.RELEASE.jar! /: 5.2.0.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh (ServletWebServerApplicationContext.java:141) ~ [spring-boot-2.2.0.BUILD-SNAPSHOT./! : 2.2.0.BUILD-SNAPSHOT] di org.springframework.boot.SpringApplication.refresh (SpringApplication.java:747) ~ [spring-boot-2.2.0.BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD- SNAPSHOT] di org.springframework.boot.SpringApplication.refreshContext (SpringApplication.java:397) ~ [spring-boot-2.2.0.BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di org.springframework. boot.SpringApplication.run (SpringApplication.java:315) ~ [spring-boot-2.2.0.BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di org.springframework.boot.SpringApplication.run (SpringApplication .java: 1226) ~ [spring-boot-2.2.0.BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di org.springframework.boot.SpringApplication.run (SpringApplication.java:1215) ~ [spring-boot-2.2.0.BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di eu. soluma.app.SolumaTdvApplication.main (SolumaTdvApplication.java:34) ~ [kelas! /: 0.0.1-SNAPSHOT] di java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Metode Asli) ~ [na: na] di java.base / jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) ~ [na: na] di java.base / jdk.internal.reflect.DelegatingMethodAccessorImpl.invode [Deleg] na: na] di java.base / java.lang.reflect.Method.invoke (Method.java 5-1067) ~ [na: na] di org.springframework.boot.loader.MainMethodRunner.run (MainMethodRunner.java:48) ~ [SolumaTDV-0.0.1-SNAPSHOT.jar: 0.0.1-SNAPSHOT] di org.springframework.boot.loader.Launcher.launch (Launcher.java:87) ~ [SolumaTDV-0.0.1-SNAPSHOT.jar: 0.0.1-SNAPSHOT] di org.springframework.boot.loader. Launcher.launch (Launcher.java:51) ~ [SolumaTDV-0.0.1-SNAPSHOT.jar: 0.0.1-SNAPSHOT] di org.springframework.boot.loader.JarLauncher.main (JarLauncher.java:52) ~ [SolumaTDV -0.0.1-SNAPSHOT.jar: 0.0.1-SNAPSHOT] Disebabkan oleh: java.lang.IllegalArgumentException: standardService.connector.startFailed di org.apache.catalina.core.StandardService.addConnector (StandardService.java?31] tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors (TomcatWebServer.java .78) ~ [spring-boot-2.2.0] .BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] di org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start (TomcatWebServer.java:197) ~ [spring-boot-2.2.0.BUILD-SNAPSHOT.jar! /: 2.2.0.BUILD-SNAPSHOT] ... 18 frame umum dihilangkan karena disebabkan oleh: org.apache.catalina.LifecycleException: Protokol pengendali mulai gagal di org.apache.catalina.connector.Connector.startInternal (Connector.java:1008) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0 .26] di org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:183) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache.catalina.core .StandardService.addConnector (StandardService.java:27) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] ... 20 frame umum dihilangkan Disebabkan oleh: java.lang.IllegalArgumentException: Aliran ditutup pada org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext (AbstractJsseEndpoint.java:99) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache.tomcat.util.net.AbstrakJsseEndpoint.initialiseSsl (AbstractJsseEndpoint.java:71) ~ [tomcat-embed-core -9.0.26.jar! /: 9.0.26] di org.apache.tomcat.util.net.NioEndpoint.bind (NioEndpoint.java://18) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache.tomcat.util.net.AbstractEndpoint.bindWithCleanup (AbstractEndpoint.java:1124) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache. tomcat.util.net.AbstractEndpoint.start (AbstractEndpoint.java:1210) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache.coyote.AbstractProtocol.start (AbstractProtocol.java : 585) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache.catalina.connector.Connector.Connector.startInternal (Connector.java:1005) ~ [tomcat-embed-core- 9.0.26.jar! /: 9.0.26] ... 22 frame umum dihilangkan Disebabkan oleh: java.io.IOException: Streaming ditutup di java.base / java.io.BufferedInputStream.getBufIfOpen (BufferedInputStream.java:176) ~ [na: na] di java.base / java.io.BufferedInputStream.read (BufferedInputStream.java:342) ~ [na: na] di java.base / java.io.BufferedInputStream.fill (BufferedInputStream.java:252) ~ [na: na] di java.base / java.io.BufferedInputStream.read (BufferedInputStream.java:71) ~ [na: na] di java.base / java.security.DigestInputStream.read (DigestInputStream.java:125) ~ [na: na] di java.base / java.io.DataInputStream.readInt (DataInputStream.java:392) ~ [na: na] di java.base / sun.security.provider.JavaKeyStore.engineLoad (JavaKeyStore.java:659) ~ [na: na] di java. base / sun.security.util.KeyStoreDelegator.engineLoad (KeyStoreDelegator.java:22) ~ [na: na] di java.base / java.security.KeyStore.load (KeyStore.java:1472) ~ [na: na] di org.apache.tomcat.util.security. KeyStoreUtil.load (KeyStoreUtil.java:69) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache.tomcat.util.net.SSLUtilBase.getStore (SSLUtilBase.java .:17 . 9.0.26.jar! /: 9.0.26] di org.apache.tomcat.util.net.SSLUtilBase.getKeyManagers (SSLUtilBase.java:83) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0 .26] di org.apache.tomcat.util.net.SSLUtilBase.createSSLContext (SSLUtilBase.java:47) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] di org.apache.tomcat .util.net.AbstractJsseEndpoint.createSSLContext (AbstractJsseEndpoint.java:97) ~ [tomcat-embed-core-9.0.26.jar! /: 9.0.26] ... 28 frame umum dihilangkan
sumber
server.ssl.key-store="C:\Keystore\mykey.jks"
file:
?Jawaban:
Ini adalah regresi yang diperkenalkan di Tomcat 9.0.25 yang akan diperbaiki di 9.0.27.
sumber
Pedro terima kasih Saya memiliki masalah dengan Spring Boot 2.1.9.RELEASE dan dapat mengonfirmasi bahwa itu diselesaikan dengan menurunkan versi ke 2.1.8.
sumber
2.1.10.RELEASE juga memperbaiki masalah yang terlihat pada 2.1.9.
sumber