????????????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 ??????!