简体   繁体   中英

PKIX path building failed:certificate missing

I created a free Oracle DB and I'am trying to connect to it via IntelliJ Database Tools.

I keep getting this error.

[08006][17002] I/O-Fehler: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target, connect lapse 32 ms., Authentication lapse 0 ms. sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target.

Where can I get this certificate?

Please help (newbie here already spent like 2 days on this)

As the link to the suggestion is not working I would recommend the following solution, which works in my case:

  1. Get the database certificate

You may use the following bash command for this:

openssl s_client -connect example.com:1234 -servername example.com:1234 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > cert.crt

Just replace the example.com:1234 with your host and port. The database certificate will be saved as cert.crt .

  1. Add the certificate to the IntelliJ database connection properties window like this:

在此处输入图像描述

I had the same problem though I was using all maven dependencies required. I tried connecting SQL Server database using Java.

This issues resolved just like that by adding the right version (Compatible for your Database server version).

I changed the mssql-jdbc version from 8.2.1.jre11 to 8.4.1.jre11 . Hope this would help somebody

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.34</version>
</dependency>
<dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>8.4.1.jre11</version>
</dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM