1.加證書(這裏不說)java
2.修改代碼網絡
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
/**
*
*
* Created by Administrator on 2016/2/17.
*/
public class FakeX509TrustManager implements X509TrustManager {
private static TrustManager[] trustManagers;
private static final X509Certificate[] _AcceptedIssuers = new
X509Certificate[] {};
dom
在調用網絡前使用ide
FakeX509TrustManager.allowAllSSL(); //it is dangerous!可是有的時候咱們須要這樣作!! //========================StringRequest===================================================== StringRequest httpRequest = new StringRequest(requestMethod, url, new Response.Listener<String>() { url