|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.archive.httpclient.ConfigurableX509TrustManager
public class ConfigurableX509TrustManager
A configurable trust manager built on X509TrustManager. If set to 'open' trust, the default, will get us into sites for whom we do not have the CA or any of intermediary CAs that go to make up the cert chain of trust. Will also get us past selfsigned and expired certs. 'loose' trust will get us into sites w/ valid certs even if they are just selfsigned. 'normal' is any valid cert not including selfsigned. 'strict' means cert must be valid and the cert DN must match server name.
Based on pointers in SSL Guide, and readings done in JSSE Guide.
TODO: Move to an ssl subpackage when we have other classes other than just this one.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT
Default setting for trust level. |
static java.lang.String[] |
LEVELS_AS_ARRAY
All the levels of trust as an array from babe-in-the-wood to strict. |
protected static java.util.logging.Logger |
logger
Logging instance. |
static java.lang.String |
LOOSE
Trust any valid cert including self-signed certificates. |
static java.lang.String |
NORMAL
Normal jsse behavior. |
static java.lang.String |
OPEN
Trust anything given us. |
static java.lang.String |
STRICT
Strict trust. |
Constructor Summary | |
---|---|
ConfigurableX509TrustManager()
|
|
ConfigurableX509TrustManager(java.lang.String level)
Constructor. |
Method Summary | |
---|---|
void |
checkClientTrusted(java.security.cert.X509Certificate[] certificates,
java.lang.String type)
|
void |
checkServerTrusted(java.security.cert.X509Certificate[] certificates,
java.lang.String type)
|
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static java.util.logging.Logger logger
public static final java.lang.String OPEN
See e502. Disabling Certificate Validation in an HTTPS Connection from the java almanac for how to trust all.
public static final java.lang.String LOOSE
public static final java.lang.String NORMAL
public static final java.lang.String STRICT
public static java.lang.String[] LEVELS_AS_ARRAY
public static final java.lang.String DEFAULT
Constructor Detail |
---|
public ConfigurableX509TrustManager() throws java.security.NoSuchAlgorithmException, java.security.KeyStoreException
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
public ConfigurableX509TrustManager(java.lang.String level) throws java.security.NoSuchAlgorithmException, java.security.KeyStoreException
level
- Level of trust to effect.
java.security.NoSuchAlgorithmException
java.security.KeyStoreException
Method Detail |
---|
public void checkClientTrusted(java.security.cert.X509Certificate[] certificates, java.lang.String type) throws java.security.cert.CertificateException
checkClientTrusted
in interface javax.net.ssl.X509TrustManager
java.security.cert.CertificateException
public void checkServerTrusted(java.security.cert.X509Certificate[] certificates, java.lang.String type) throws java.security.cert.CertificateException
checkServerTrusted
in interface javax.net.ssl.X509TrustManager
java.security.cert.CertificateException
public java.security.cert.X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers
in interface javax.net.ssl.X509TrustManager
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |