Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
Java

Journal trajano's Journal: SSL bypass in Java

X509TrustManager trustManager =
new X509TrustManager() {
    public X509Certificate[] getAcceptedIssuers() {
        return null;
    }

    public void checkClientTrusted(X509Certificate[] arg0, String arg1)
        throws CertificateException {
    }

    public void checkServerTrusted(X509Certificate[] arg0, String arg1)
        throws CertificateException {
    }
};

SSLContext context = SSLContext.getInstance("SSLv3");
TrustManager[] trustManagerArray = {
    trustManager
};
context.init(null, trustManagerArray, new SecureRandom());
HttpsURLConnection.setDefaultSSLSocketFactory(context.getSocketFactory());
This discussion has been archived. No new comments can be posted.

SSL bypass in Java

Comments Filter:

"There is such a fine line between genius and stupidity." - David St. Hubbins, "Spinal Tap"

Working...