|
|
@ -20,11 +20,7 @@ import java.security.cert.X509Certificate; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map.Entry; |
|
|
|
import java.util.Map.Entry; |
|
|
|
|
|
|
|
|
|
|
|
import javax.net.ssl.HttpsURLConnection; |
|
|
|
import javax.net.ssl.*; |
|
|
|
import javax.net.ssl.SSLContext; |
|
|
|
|
|
|
|
import javax.net.ssl.SSLSocketFactory; |
|
|
|
|
|
|
|
import javax.net.ssl.TrustManager; |
|
|
|
|
|
|
|
import javax.net.ssl.X509TrustManager; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -68,6 +64,12 @@ public class HttpKit { |
|
|
|
http.setSSLSocketFactory(ssf); |
|
|
|
http.setSSLSocketFactory(ssf); |
|
|
|
http.setDoOutput(true); |
|
|
|
http.setDoOutput(true); |
|
|
|
http.setDoInput(true); |
|
|
|
http.setDoInput(true); |
|
|
|
|
|
|
|
http.setHostnameVerifier(new HostnameVerifier() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
http.connect(); |
|
|
|
http.connect(); |
|
|
|
|
|
|
|
|
|
|
|
InputStream in = http.getInputStream(); |
|
|
|
InputStream in = http.getInputStream(); |
|
|
@ -133,6 +135,12 @@ public class HttpKit { |
|
|
|
http.setSSLSocketFactory(ssf); |
|
|
|
http.setSSLSocketFactory(ssf); |
|
|
|
http.setDoOutput(true); |
|
|
|
http.setDoOutput(true); |
|
|
|
http.setDoInput(true); |
|
|
|
http.setDoInput(true); |
|
|
|
|
|
|
|
http.setHostnameVerifier(new HostnameVerifier() { |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public boolean verify(String s, SSLSession sslSession) { |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
http.connect(); |
|
|
|
http.connect(); |
|
|
|
OutputStream out = http.getOutputStream(); |
|
|
|
OutputStream out = http.getOutputStream(); |
|
|
|
out.write(params.getBytes("UTF-8")); |
|
|
|
out.write(params.getBytes("UTF-8")); |
|
|
|