Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- System.setProperty("javax.net.debug", "all");
- adding as trusted cert:
- Subject: CN=Entrust.net Certification Authority (2048), OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), O=Entrust.net
- Issuer: CN=Entrust.net Certification Authority (2048), OU=(c) 1999 Entrust.net Limited, OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.), O=Entrust.net
- Algorithm: RSA; Serial number: 0x3863def8
- Valid from Fri Dec 24 12:50:51 EST 1999 until Tue Jul 24 10:15:12 EDT 2029
- main, READ: TLSv1 Handshake, length = 2649
- *** Certificate chain
- chain [0] = [0] Version: 3
- SerialNumber: 1356119177
- IssuerDN: C=US,O=Entrust, Inc.,OU=See www.entrust.net/legal-terms,OU=(c) 2012 Entrust, Inc. - for authorized use only,CN=Entrust Certification Authority - L1K
- Start Date: Wed Jul 15 11:50:20 EDT 2015
- Final Date: Sun Jul 15 18:27:04 EDT 2018
- ***
- Caught: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException:
- PKIX path building failed: java.security.cert.CertPathBuilderException:
- No issuer certificate for certificate in certification path found.
- main, SEND TLSv1 ALERT: fatal, description = certificate_unknown
- private class TrustAll implements X509TrustManager
- {
- public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException
- {
- }
- public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException
- {
- }
- public X509Certificate[] getAcceptedIssuers()
- {
- return new X509Certificate[0];
- }
- TrustManager[] trustArray = [new TrustAll()] as TrustManager[]
- SSLContext ctx = SSLContext.getInstance("TLSv1");
- ctx.init(null, trustArray, null);
- // create an http client builder
- HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
- httpClientBuilder.setSslcontext(ctx)
- httpclient = httpClientBuilder.build();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement