| 384 | |
| 385 | //This function creates a ThreadSafeClientConnManager that trusts everyone! |
| 386 | public ClientConnectionManager getTSCCM(HttpParams params) { |
| 387 | |
| 388 | KeyStore trustStore; |
| 389 | try { |
| 390 | |
| 391 | trustStore = KeyStore.getInstance(KeyStore.getDefaultType()); |
| 392 | trustStore.load(null, null); |
| 393 | |
| 394 | SSLSocketFactory sf = new TrustAllSSLSocketFactory(trustStore); |
| 395 | sf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); |
| 396 | |
| 397 | SchemeRegistry registry = new SchemeRegistry(); |
| 398 | registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); |
| 399 | registry.register(new Scheme("https", sf, 443)); |
| 400 | |
| 401 | ClientConnectionManager ccm = new ThreadSafeClientConnManager(params, registry); |
| 402 | |
| 403 | return ccm; |
| 404 | |
| 405 | } catch (Exception e) { |
| 406 | return null; |
| 407 | } |
| 408 | } |
| 409 | |
| 410 | //This function determines what object we are dealing with. |
| 411 | public ClientConnectionManager getCCM(Object o, HttpParams params) { |