M Michael1968 Active Member Licensed User Longtime User Apr 24, 2016 #1 Hi all, I try to connect to a webserver via SSL to get status of a port. I try this: Code: Dim job As HttpJob 'Init the job job.Initialize("getio", Me) 'HTTP GET IO Port State job.Download("https://iot.seeed.cc/v1/node/resources?access_token=xxxxxxxxxx") job.GetRequest.SetHeader("Content-Type", "text/plain") I get this Error: 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.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1937) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1478) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391) Click to expand... I use httputils2 and OKhttputils2 with no successe. with Firefox and chrome the URL works perfect. Thanks Michael
Hi all, I try to connect to a webserver via SSL to get status of a port. I try this: Code: Dim job As HttpJob 'Init the job job.Initialize("getio", Me) 'HTTP GET IO Port State job.Download("https://iot.seeed.cc/v1/node/resources?access_token=xxxxxxxxxx") job.GetRequest.SetHeader("Content-Type", "text/plain") I get this Error: 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.Alerts.getSSLException(Alerts.java:192) at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1937) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:302) at sun.security.ssl.Handshaker.fatalSE(Handshaker.java:296) at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1478) at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:212) at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1050) at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1363) at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1391) Click to expand... I use httputils2 and OKhttputils2 with no successe. with Firefox and chrome the URL works perfect. Thanks Michael
Erel B4X founder Staff member Licensed User Longtime User Apr 24, 2016 #2 The JVM doesn't recognize this certificate. You will need to use OkHttpUtils2 source code and change hc.Initialize with hc.InitializeAcceptAll (which means that it doesn't check the certificate). Upvote 0
The JVM doesn't recognize this certificate. You will need to use OkHttpUtils2 source code and change hc.Initialize with hc.InitializeAcceptAll (which means that it doesn't check the certificate).
M Michael1968 Active Member Licensed User Longtime User Apr 24, 2016 #3 Erel said: The JVM doesn't recognize this certificate. You will need to use OkHttpUtils2 source code and change hc.Initialize with hc.InitializeAcceptAll (which means that it doesn't check the certificate). Click to expand... thx a lot now its working best regards Michael Upvote 0
Erel said: The JVM doesn't recognize this certificate. You will need to use OkHttpUtils2 source code and change hc.Initialize with hc.InitializeAcceptAll (which means that it doesn't check the certificate). Click to expand... thx a lot now its working best regards Michael