I am importing a certicate in .jks file using keytool, and I tried to communicate with Directory Active 2012 R2.

I'm using spring boot, java 8, but when I run the program it's fails

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

my application.yml files

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

the ir_hcm_ad.p12 file

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                                         ...

I expect solve the error:

Caused by: java.lang.IllegalArgumentException: Alias name [certificado_ad_p12] does not identify a key entry

0 Answers