Spring tool suite- SunCertPathBuilderException: unable to find valid certification path to requested target

后端 未结 8 636
予麋鹿
予麋鹿 2021-01-13 06:12

I am working on STS and while creating a new spring-boot project, it shows following error:

 SunCertPathBuilderException: unable to find valid certification          


        
相关标签:
8条回答
  • 2021-01-13 06:23

    In the case if none of above work, try below steps. It works fine for me as I was also working under corporate network, had same issue.

    1. Close STS tool if open.
    2. Locate STS.ini file (mostly where you have installed STS tool and have STS.exe)
    3. Edit STS.ini. Add following two line at the bottom (Use your JDK location, below one is just a sample)

      -Djavax.net.ssl.trustStore=C:\Program Files\Java\jdk1.8.0_20\jre\lib\security\cacerts

      -Djava.net.ssl.trustStorePassword=changeit

    4. Save STS.ini and restart the STS.exe.

    It works in my case. Thank you.

    0 讨论(0)
  • 2021-01-13 06:25

    I encountered the same problem and tried this: Window -> Preferences -> Network Connections Change mode to Manual

    It works fine now.

    0 讨论(0)
  • 2021-01-13 06:32

    Try http instead of https in the URL http://start.spring.io

    The following error will be resolved "SunCertPathBuilderException: unable to find valid certification path to requested target"

    0 讨论(0)
  • 2021-01-13 06:35

    Adding below to eclipse.ini

    -Djavax.net.ssl.trustStore=C:\Program Files\Java\jdk1.8.0_20\jre\lib\security\cacerts
    -Djava.net.ssl.trustStorePassword=changeit
    

    worked for me.

    0 讨论(0)
  • 2021-01-13 06:41

    The simplest solution is to install your corporate certificate into the cacerts keystore of the JDK.

    <JAVA_HOME>/bin/keytool -import -alias CorpProxy -keystore <JAVA_HOME>/jre/lib/security/cacerts -file your_corp_cert.crt
    

    You will be prompted for the keystore password which is changeit by default.

    0 讨论(0)
  • 2021-01-13 06:45

    I was able to resolve the issue following two steps.

    1. Firstly I imported certificate present on https://start.spring.io into the jdk cacerts.
    2. Atlast I added the path of TrustStore and trustStore password in SpringToolSuite4.ini file.

      -Djavax.net.ssl.trustStore=C:\Program Files\Java\jdk1.8.0_201\jre\lib\security\cacerts

      -Djava.net.ssl.trustStorePassword=changeit

    0 讨论(0)
提交回复
热议问题