Skip to content
Java tool for testing validity (certificates) of trust stores
Java
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src/main/java/sk/mhecko/ssl
.gitignore
LICENSE Initial commit Apr 21, 2017
README.md Update README.md Mar 19, 2019
build.gradle
gradlew
gradlew.bat Update gradle wrapper version to 5.2.1 Mar 19, 2019

README.md

SSLPoke

Test of java SSL / keystore / cert setup. Came from https://confluence.atlassian.com/download/attachments/117455/SSLPoke.java

Use Gradle to build standalone JAR file:

./gradlew clean jar

Usage:

  1. Negative test SSL connection:

    java -jar build/libs/SSLPoke-1.0.jar <server> 443

    you should get exception like this:

    javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    
  2. Create new empty keystore and add exported certificate from server:

    keytool -import -file certificate.cert -alias certificate -keystore trustStore.keystore
    
  3. Do the test again and specify trustStore with password:

    java -Djavax.net.ssl.trustStore=trustStore.keystore -Djavax.net.ssl.trustStorePassword=changeit -jar build/libs/SSLPoke-1.0.jar <server> 443

    you should get positive answer:

    Successfully connected

You can’t perform that action at this time.