I am getting error
22:00:17.222 [pool-6-thread-1] ERROR ingrian.internal.xml.XMLAuthToken - handshakeCompleted: SSL handshake did not complete within alloted time {}
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
at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[?:1.8.0_351]
in my Intellij IDE, when I am running any Java file, but when I am running mvn clean install, the build is getting successful. I have added all the required certificates.
mvn --version
Maven home: /usr/local/Cellar/maven/3.5.4/libexec
Java version: 1.8.0_351, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/jdk1.8.0_351.jdk/Contents/Home/jre
IDE Run Config
IDE Run Config
Intellij was running fine, before, I replaced the old certs with the new certs and then it started giving this error.
I have downloaded new java version, new IDE version as well, cleared the old cache, but nothing seems to work.
Is there any configuration in Intellij that I have to update?
I encountered this error while on Mac OS. My Issue was when trying to download dependencies located in https://repo.maven.apache.org/maven2/org/slf4j/slf4j-simple/2.0.7/slf4j-simple-2.0.7.pom from maven central while using Intellij Idea.
Steps to resolve:
https://repo.maven.apache.org/maven2/org/slf4j/slf4j-simple/2.0.7/slf4j-simple-2.0.7.pom on your browser.Connection is secure then Certificate is valid.Next we are going to import the certificate on two keystores. First on our JDK keystore and later on the keystore used by the IDE.
Import on JDK keystore.
Navigate to security folder on JAVA_HOME. For my case locate /Library/Java/JavaVirtualMachines/jdk-11.0.16.1.jdk/Contents/Home/lib/security. In this list you will see a file cacerts which is a collection of trusted certificates. we need to import our downloaded certificate here using the command sudo keytool -importcert -alias maven -file ~/Desktop/repo.maven.apache.org.cer -keystore cacerts. Note in my case I downloaded the certificate to trust on my Desktop folder and named repo.maven.apache.org.cer. When prompted enter you password as changeit for truststore.
Next we need to trust the certificate within our IDE's security folder. cd /Applications/IntelliJ IDEA 19.05.39.app/Contents/jbr/Contents/Home/lib/security. Note my IDE's version as the location my change a bit based on the version of IDE you are using.
Import the downloaded certificate using sudo keytool -importcert -alias maven -file ~/Desktop/repo.maven.apache.org.cer -keystore cacerts. Enter your user password when prompted and changeit for keystore password.
Restart your IDE.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With