Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

javax.net.ssl.trustStore trustall

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import java.security.cert.X509Certificate;


//The actual trust all TrustManager code.

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

    public void checkClientTrusted(X509Certificate[] certs, String authType) {

    }

    public void checkServerTrusted(X509Certificate[] certs, String authType) {
    }
};

SSLContext sc = SSLContext.getInstance("SSL");
sc.init(null, new TrustManager[] { trm }, null);
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
Comment

PREVIOUS NEXT
Code Example
Java :: how to create a sublist in java 
Java :: Java Using of() Method 
Java :: Android Studio First time run check 
Java :: strictfp java example 
Java :: add new item to array java 
Java :: What is builder tool 
Java :: Transversal operation in java array 
Java :: how to pass parameters to xsl file 
Java :: how to hide search from menu android studio from activity 
Java :: layout focus from recycleview not from top in fragment inside nestedScrollview in android xml 
Java :: add external JARs to java vscode 
Java :: Using Looping Construct to Copy Arrays Java 
Java :: Java TestNG Data Provider 
Java :: sum of number from list 
Java :: How can I add a listener on the ok button of JOptionPane 
Java :: num1 * num2 
Java :: java platform runlater keeps running 
Java :: Java @FunctionalInterface annotation 
Java :: code for working clock in java eclipse 
Java :: jsp multipart/form-data submition 
Java :: java string replace last 4 characters 
Java :: setbackgroundcolor android 
Java :: add dynamic view in android from xml 
Java :: hello world in bukkit 
Java :: how to count an replace string in java 
Java :: how to start java project in intellij 
Java :: advantages of iterator in java 
Java :: android studio see what activity you came from 
Java :: can you automate mouseclicks with java 
Java :: sibling search java program 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =