1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package net.sf.jameleon.util;
20
21 import javax.net.ssl.X509TrustManager;
22
23 import java.security.KeyStore;
24 import java.security.KeyStoreException;
25 import java.security.NoSuchAlgorithmException;
26 import java.security.cert.CertificateException;
27 import java.security.cert.X509Certificate;
28
29 /***
30 * A X509TrustManager that trusts everything. This is used for those sites where the
31 * SSL is known to be invalid.
32 */
33 public class X509TrustEverythingManager implements X509TrustManager {
34
35 /***
36 * Constructor for EasyX509TrustManager.
37 */
38 public X509TrustEverythingManager() {
39 }
40
41 /***
42 * Constructor for EasyX509TrustManager.
43 */
44 public X509TrustEverythingManager(KeyStore keystore) throws NoSuchAlgorithmException, KeyStoreException {
45 }
46
47 public boolean isClientTrusted(X509Certificate[] chain){
48 return true;
49 }
50
51 public boolean isServerTrusted(X509Certificate[] chain){
52 return true;
53 }
54
55 public X509Certificate[] getAcceptedIssuers() {
56 return new X509Certificate[0];
57 }
58
59 public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException {
60
61 }
62
63 public void checkClientTrusted(X509Certificate[] certs, String authType) throws CertificateException {
64
65 }
66 }