How to ignore SSL Certificate Java

JPG :

I keep getting this exception "javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names matching IP address xxx.xxx.xx.xxx found" on a http get request. I've tried pretty much everything already. Is there a JVM argument that i can use to ignore SSL certificates?

These are the VM arguments running on my JBOSS.

"-Dprogram.name=JBossTools: Red Hat JBoss EAP 6.1+" -server -Xms1024m -Xmx1024m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Djava.net.preferIPv4Stack=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

Thiago Procaci :

Have you tried to use this class?

Add it to your project and then make a static call.

 static {
        SSLUtilities.trustAllHostnames();
        SSLUtilities.trustAllHttpsCertificates();
    }

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=100597&siteId=1