How to Capture a Certificate in a Java Keystore

$ ./gradlew build
> Could not GET '
> PXIX path building failed:

"unable to find valid certificate path to requested target"

$ openssl s_client -connect 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'

This will produce the certificat for the URL connected to. Save the output in wallaby.cert the import it into a java keystore:

$ keytool -import -alias wallaby -file wallaby.cert -keystore planets.jks

To use the keystore within the build configure the keystore in<PATH_TO_KEYSTORE>/planets.jks


In a Maven based build you could specify the properties via 'MAVEN_OPTS':

Show Comments