我正在使用keytool在.jks文件中导入证书,并且尝试与Directory Active 2012 R2通信。
我正在使用Spring Boot Java 8,但是当我运行程序时它失败了
03-05-2019 11:58:09.444 [main] ERROR org.apache.catalina.core.StandardService.log - Failed to start connector [Connector[HTTP/1.1-9029]]
org.apache.catalina.LifecycleException: Failed to start component [Connector[HTTP/1.1-9029]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
at org.apache.catalina.core.StandardService.addConnector(StandardService.java:225)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.addPreviouslyRemovedConnectors(TomcatWebServer.java:256)
at org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start(TomcatWebServer.java:198)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer(ServletWebServerApplicationContext.java:300)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:162)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
at com.intercorp.retail.MicroserviceOracleHcmADApplication.main(MicroserviceOracleHcmADApplication.java:15)
Caused by: org.apache.catalina.LifecycleException: Protocol handler start failed
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1020)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 common frames omitted
Caused by: java.lang.IllegalArgumentException: Alias name [certificado_ad_p12] does not identify a key entry
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:116)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.initialiseSsl(AbstractJsseEndpoint.java:87)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:225)
at org.apache.tomcat.util.net.AbstractEndpoint.start(AbstractEndpoint.java:1150)
at org.apache.coyote.AbstractProtocol.start(AbstractProtocol.java:591)
at org.apache.catalina.connector.Connector.startInternal(Connector.java:1018)
... 12 common frames omitted
Caused by: java.io.IOException: Alias name [certificado_ad_p12] does not identify a key entry
at org.apache.tomcat.util.net.jsse.JSSEUtil.getKeyManagers(JSSEUtil.java:229)
at org.apache.tomcat.util.net.AbstractJsseEndpoint.createSSLContext(AbstractJsseEndpoint.java:114)
... 17 common frames omitted
我的application.yml文件
server:
port: 9029
ssl:
key-store: classpath:keystore/ir_hcm_ad.p12
key-store-password: 12345678
keyStoreType: PKCS12
keyAlias: certificado_ad_p12
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/retail_ad?useSSL=false
ir_hcm_ad.p12文件
Introduzca la contraseña del almacén de claves:
Tipo de Almacén de Claves: PKCS12
Proveedor de Almacén de Claves: SUN
Su almacén de claves contiene 1 entrada
certificado_ad_p12, 03/05/2019, trustedCertEntry,
Huella Digital de Certificado (SHA1): FE:C8:D1:2F:5F:07:F4:32:A7:F3:71:F7:CF:B8:C5:63:B6:F8:30:87 ...
我希望解决该错误:
原因:java.lang.IllegalArgumentException:别名 [certificado_ad_p12]无法识别密钥条目