External pfx certificate in tomcat

0

A Provider passed us a pfx certificate to call a service that gives us a token. I tried to use the certificate from a java client in the following way:

  • Transform the certificate into a jsk

    keytool -importkeystore -srckeystore /home/certificados/keyStore.pfx -srcstoretype pkcs12 -destkeystore /home/certificados/keyStore.jks -deststoretype jks 
    
  • I ran an application that requests the token with the parameters

    -Djavax.net.ssl.keyStore=/home/certificados/keyStore.jks -Djavax.net.ssl.keyStorePassword=password
    
  • The main one I tried with: link

The result was as expected.

But when I run the same thing on a tomcat I can not get it to work properly. The response of the method is a 200 but it does NOT provide the token, but an error that represents the lack of the certificate.

  • Maybe the problem is here:

    http-bio-8080-exec-1, READ: TLSv1.2 Handshake, length = 4
    *** ServerHelloDone
    Warning: no suitable certificate found - continuing without client authentication
    *** Certificate chain
    <Empty>
    ***
    

The tomcat process runs with the following arguments

/usr/bin/java -Djava.util.logging.config.file=/home/log/apache-tomcat-    
7.0.88/conf/logging.properties -
Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager- 
Djdk.tls.ephemeralDHKeySize=2048 -
Djavax.net.ssl.keyStore=/home/certificados/keyStore.jks -
Djavax.net.ssl.keyStorePassword=password -Xdebug -Xnoagent -
Xrunjdwp:transport=dt_socket,address=4040,server=y,suspend=n -
Djavax.net.debug=ssl -Dignore.endorsed.dirs= -classpath 
/home/pablo/apache-tomcat-7.0.88/bin/bootstrap.jar:/home/pablo/apache-
tomcat-7.0.88/bin/tomcat-juli.jar -Dcatalina.base=/home/pablo/apache-
tomcat-7.0.88 -Dcatalina.home=/home/pablo/apache-tomcat-7.0.88 -
Djava.io.tmpdir=/home/pablo/apache-tomcat-7.0.88/temp     
org.apache.catalina.startup.Bootstrap start

Java version:

java version "1.8.0_171"
Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)

Tomcat Version:

Server version: Apache Tomcat/7.0.88
Server built:   May 7 2018 11:12:57 UTC
Server number:  7.0.88.0
OS Name:        Linux
OS Version:     4.13.0-39-generic
Architecture:   amd64
JVM Version:    1.8.0_171-b11
JVM Vendor:     Oracle Corporation    
    
asked by pablo 17.09.2018 в 20:19
source

0 answers