aleph

miikka 2017-04-25T12:37:16.993066Z

I'm getting this kind of errors when trying to use Aleph HTTP client for HTTPS. Anyone know what's going on?

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 sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)
        at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)
        at sun.security.validator.Validator.validate(Validator.java:260)
        at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)
        at sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:281)
        at sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136)
        at sun.security.ssl.ClientHandshaker.serverCertificate(ClientHandshaker.java:1496)
        ... 26 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
        at sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:146)
        at sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:131)
        at java.security.cert.CertPathBuilder.build(CertPathBuilder.java:280)
        at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:382)
        ... 32 more

miikka 2017-04-25T12:40:47.044977Z

Okay, I guess my JVM cacerts is outdated and I should update Java. Or something.

lvh 2017-04-25T13:57:35.491506Z

that’s one way

lvh 2017-04-25T13:57:47.495790Z

I’m pretty sure you can pass it a custom netty object if you really want to

miikka 2017-04-25T15:06:23.131995Z

Well, upgrading Java made Let's Encrypt certs work, but actually I need to connect to a site with a StartSSL cert, so I passed in a SSL context that uses the StartSSL CA cert

miikka 2017-04-25T15:07:05.149497Z

(I was first testing with https://httpbin.org/ which uses Let's Encrypt)