Skip to content

Could not install board java ValidatorException #7948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MaSven opened this issue Aug 29, 2018 · 6 comments
Closed

Could not install board java ValidatorException #7948

MaSven opened this issue Aug 29, 2018 · 6 comments
Labels
Component: IDE The Arduino IDE Java 9+ Related to porting the Arduino IDE to use Java version 9 or newer Type: Bug

Comments

@MaSven
Copy link

MaSven commented Aug 29, 2018

Tried to download Boardinformation from
but only get an java Exception. Here is the stacktrace.

 Fehler beim Herunterladen von https://downloads.arduino.cc/CMSIS-Atmel-1.2.0.tar.bz2
java.lang.RuntimeException: java.lang.Exception: Fehler beim Herunterladen von https://downloads.arduino.cc/CMSIS-Atmel-1.2.0.tar.bz2
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$1(ContributionManagerUI.java:176)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.Exception: Fehler beim Herunterladen von https://downloads.arduino.cc/CMSIS-Atmel-1.2.0.tar.bz2
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:131)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:69)
	at cc.arduino.contributions.packages.ContributionInstaller.install(ContributionInstaller.java:110)
	at cc.arduino.contributions.packages.ui.ContributionManagerUI.lambda$onInstallPressed$1(ContributionManagerUI.java:173)
	... 1 more
Caused by: 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 java.base/sun.security.ssl.Alerts.getSSLException(Alerts.java:198)
	at java.base/sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1974)
	at java.base/sun.security.ssl.Handshaker.fatalSE(Handshaker.java:345)
	at java.base/sun.security.ssl.Handshaker.fatalSE(Handshaker.java:339)
	at java.base/sun.security.ssl.ClientHandshaker.checkServerCerts(ClientHandshaker.java:1968)
	at java.base/sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1777)
	at java.base/sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:264)
	at java.base/sun.security.ssl.Handshaker.processLoop(Handshaker.java:1098)
	at java.base/sun.security.ssl.Handshaker.processRecord(Handshaker.java:1026)
	at java.base/sun.security.ssl.SSLSocketImpl.processInputRecord(SSLSocketImpl.java:1137)
	at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1074)
	at java.base/sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
	at java.base/sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1402)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1429)
	at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
	at java.base/sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:567)
	at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:163)
	at cc.arduino.utils.network.FileDownloader.downloadFile(FileDownloader.java:170)
	at cc.arduino.utils.network.FileDownloader.download(FileDownloader.java:128)
	at cc.arduino.contributions.DownloadableContributionsDownloader.download(DownloadableContributionsDownloader.java:129)
	... 4 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:385)
	at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:290)
	at java.base/sun.security.validator.Validator.validate(Validator.java:264)
	at java.base/sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:343)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:226)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:133)
	at java.base/sun.security.ssl.ClientHandshaker.checkServerCerts(ClientHandshaker.java:1947)
	... 20 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
	at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:380)
	... 26 more

Seems like an cacert is missing here?
Using ArduinoIDE version 1.8.5 provided by flathub.
Using java version

java version "10.0.2" 2018-07-17
Java(TM) SE Runtime Environment 18.3 (build 10.0.2+13)
Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.2+13, mixed mode)
@MaSven
Copy link
Author

MaSven commented Aug 29, 2018

Ok seems like the flatpak build is using openjdk i think. Dont know if flatpak uses the java version of the host or not but here are the build files

@facchinm
Copy link
Member

We didn't yet start the porting effort to Java9/10 so there will be incompatibilities for sure. Probably newer version enforce the SSL check that's failing

Caused by: 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

I'm checking with the IT team to make sure it's not a problem on our side; thanks for reporting!

@facchinm facchinm added the Java 9+ Related to porting the Arduino IDE to use Java version 9 or newer label Aug 30, 2018
@MaSven
Copy link
Author

MaSven commented Aug 30, 2018

Also opened this ticket for the builder of the flatpak. Since java 9 the certs have changed and some got dropped. I think to resolve this they have to build against openjdk-8 and also bundle it with this version.

@MChima
Copy link

MChima commented May 3, 2019

Hello,
I have the same issue with the internet from the company I'm in. On the personal laptop (with Windows 10) I do not encounter it.
Issue is happening with Arduino IDE 1.88 and 1.89, but doesn't happen with version 1.8.7.
The Operating system (on the work PC where I encountered the above issue) is Windows 7 on x64.
Java platforms installed are: 1.8.0_211 _x86_64 and 1.8.0_211. (Version 8 Update 211 build 1.8.0_2111-b12).

I also tried all the google provided solutions (the _setx JAVA_OPTIONS -Djava.net.preferIPv4Stack=true command, I tried to add the certificates from the website manually to the java folder in the cacerts file because the website can be accessed from Chrome or Mozilla browsers, My company is not using any proxy servers but I also tried to specify no proxy in the Arduino IDE preferences window, I disabled with my IT the firewalls and the antivirus temporarily to see if it is blocked by it but the antivirus and the firewalls were not blocking it, and many more other "workarounds" found via google).
The solution for me was to return from versions 1.88 and 1.8.9 to 1.8.7.

Arduino IDE version 1.8.7 doesn't have any issues downloading the libraries and the boards from the https://downloads.arduino.cc/packages/package_index.json

@MattCosturos
Copy link

Hey MChima,

Arduino installs it's own jre in C:\Program Files (x86)\Arduino\java\ and that cacerts file needs to be updated!

So try to manually import the certs into the cacerts file in the JRE which was installed in the Arduino directory! (not in the global java directory!)

@MChima
Copy link

MChima commented May 6, 2019

Hi MattCosturos,

Thank you very much for the suggestion, I did not knew that Arduino uses his own java !
I tried to import them manually into Arduino IDE 1.8.9 and it did not worked, I get the same error when I try for example to open Board manager.
I saved the cert file as base64. below is the output of the command line

C:\Program Files (x86)\Arduino\java\bin>keytool -import -trustcacerts -keystore "C:\Program Files (x86)\Arduino\java\lib\security\cacerts" -stor
epass changeit -alias Root -file "C:\Program Files (x86)\Arduino\Arduino.cer"
Picked up _JAVA_OPTIONS: -Djava.net.preferIPv4Stack=true
Owner: CN=downloads.arduino.cc, O="OpenDNS, Inc.", L=San Francisco, ST=California, C=US
Issuer: O=Cisco, CN=Cisco Umbrella Secondary SubCA fra-SG
Serial number: 3cac4ab7
Valid from: Sat May 04 12:02:44 EEST 2019 until: Thu May 09 12:02:44 EEST 2019
Certificate fingerprints:
         MD5:  B1:05:BA:07:48:26:49:84:F7:73:36:1C:34:E5:B5:3C
         SHA1: 4A:93:8D:2B:39:C7:7A:1F:F8:55:A3:4F:F0:61:01:97:7D:33:D7:0A
         SHA256: 94:7E:68:57:B6:44:AF:70:CD:82:AD:A3:C5:C2:93:3B:E9:70:93:E0:6C:2D:13:C0:6F:BB:38:17:BD:10:84:FD
Signature algorithm name: SHA256withRSA
Subject Public Key Algorithm: 2048-bit RSA key
Version: 3

Extensions:

#1: ObjectId: 2.5.29.17 Criticality=false
SubjectAlternativeName [
  DNSName: downloads.arduino.cc
]

Trust this certificate? [no]:  yes
Certificate was added to keystore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: IDE The Arduino IDE Java 9+ Related to porting the Arduino IDE to use Java version 9 or newer Type: Bug
Projects
None yet
Development

No branches or pull requests

5 participants