Https VS Http ??????
???????????? ???????[ 2012/10/9 13:08:10 ] ????????
????????????https ?????????????????????????????????????! ??????????? ???Android????https???????
????private X509TrustManager xtm = new X509TrustManager() {
????public void checkClientTrusted(X509Certificate[] chain?? String authType) {
????}
????public void checkServerTrusted(X509Certificate[] chain?? String authType) {
????// System.out.println("cert: " + chain[0].toString() + "?? authType: "
????// + authType);
????}
????public X509Certificate[] getAcceptedIssuers() {
????return null;
????}
????};
????private HostnameVerifier hnv = new HostnameVerifier() {
????public boolean verify(String hostname?? SSLSession session) {
????//??????
????return true;
????}
????};
????private HttpsUtils() {
????SSLContext sslContext = null;
????try {
????sslContext = SSLContext.getInstance("TLS");
????X509TrustManager[] xtmArray = new X509TrustManager[] { xtm };
????sslContext.init(null?? xtmArray?? new java.security.SecureRandom());
????} catch (GeneralSecurityException gse) {
????}
????if (sslContext != null) {
????HttpsURLConnection.setDefaultSSLSocketFactory(sslContext
????.getSocketFactory());
????}
????HttpsURLConnection.setDefaultHostnameVerifier(hnv);
????}
????private static HttpsUtils instance = null;
????public static HttpsUtils getInstance(){
????if (instance == null) {
????instance = new HttpsUtils();
????}
????return instance;
????}
???????????
?????????????????????????????????????!?????????????????????? ???Testin ??????!
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11