Skip to content

Instantly share code, notes, and snippets.

View MdGolam-Kibria's full-sized avatar
🎯
Focusing

Golam Kibria MdGolam-Kibria

🎯
Focusing
View GitHub Profile
@MdGolam-Kibria
MdGolam-Kibria / sslHandshakeIgnoreRestTemplate.java
Created August 22, 2024 06:42
RestTemplate bean for ignore SSL Handshake and call using and without proxy server.
@Bean("sslHandshakeIgnoreRestTemplate")
public RestTemplate sslHandshakeIgnoreRestTemplate() {
// Create a TrustManager that accepts all certificates
TrustManager[] trustAllCertificates = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
return null;
}
public void checkClientTrusted(X509Certificate[] certs, String authType) {}
public void checkServerTrusted(X509Certificate[] certs, String authType) {}