Created
February 24, 2025 18:40
-
-
Save diegolovison/49133765475d3ec6fa91560309b16edf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SSLContext sslContext = SSLContext.getInstance("SSL"); | |
sslContext.init(null, new TrustManager[] { | |
new X509ExtendedTrustManager() { | |
@Override | |
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException { | |
} | |
@Override | |
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException { | |
} | |
@Override | |
public X509Certificate[] getAcceptedIssuers() { | |
return new X509Certificate[0]; | |
} | |
@Override | |
public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { | |
} | |
@Override | |
public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { | |
} | |
@Override | |
public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException { | |
} | |
@Override | |
public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException { | |
} | |
} | |
}, new SecureRandom()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment