Package tenapull.client
Class AcceptAnySSL
java.lang.Object
tenapull.client.AcceptAnySSL
public class AcceptAnySSL
extends java.lang.Object
Static utility class for constructing a Jersey client that accepts any SSL certificate
-
Method Summary
Modifier and Type Method Description static javax.ws.rs.client.Client
makeClient()
Make Jersey client which accepts any SSL certificate.static javax.net.ssl.HostnameVerifier
makeHostnameVerifier()
Make hostname verifier that ignores differences between given hostname and certificate hostnamestatic javax.net.ssl.SSLContext
makeSSLContext()
Creates SSL context that trusts all certificates
See resources:
https://stackoverflow.com/questions/875467/java-client-certificates-over-https-ssl
http://useof.org/java-open-source/org.glassfish.jersey.SslConfigurator
https://www.techieshah.com/2019/08/jersey-client-how-to-skip-ssl.html
https://stackoverflow.com/questions/6047996/ignore-self-signed-ssl-cert-using-jersey-client
https://stackoverflow.com/questions/12060250/ignore-ssl-certificate-errors-with-java/42823950
IMPORT TRUSTED SSL:
https://stackoverflow.com/questions/6659360/how-to-solve-javax-net-ssl-sslhandshakeexception-error/6742204#6742204
-
Method Details
-
makeClient
public static javax.ws.rs.client.Client makeClient()Make Jersey client which accepts any SSL certificate.- Returns:
- the client
-
makeSSLContext
public static javax.net.ssl.SSLContext makeSSLContext()Creates SSL context that trusts all certificates
See resources:
https://stackoverflow.com/questions/875467/java-client-certificates-over-https-ssl
http://useof.org/java-open-source/org.glassfish.jersey.SslConfigurator
https://www.techieshah.com/2019/08/jersey-client-how-to-skip-ssl.html
https://stackoverflow.com/questions/6047996/ignore-self-signed-ssl-cert-using-jersey-client
https://stackoverflow.com/questions/12060250/ignore-ssl-certificate-errors-with-java/42823950
IMPORT TRUSTED SSL:
https://stackoverflow.com/questions/6659360/how-to-solve-javax-net-ssl-sslhandshakeexception-error/6742204#6742204- Returns:
- the ssl context
-
makeHostnameVerifier
public static javax.net.ssl.HostnameVerifier makeHostnameVerifier()Make hostname verifier that ignores differences between given hostname and certificate hostname- Returns:
- the hostname verifier
-