Class ConfigurableX509TrustManager
java.lang.Object
org.archive.httpclient.ConfigurableX509TrustManager
- All Implemented Interfaces:
TrustManager,X509TrustManager
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.
- Version:
- $Id$
- Author:
- stack
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConfigurableX509TrustManager.TrustLevelDefault setting for trust level.protected static LoggerLogging instance. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckClientTrusted(X509Certificate[] certificates, String type) voidcheckServerTrusted(X509Certificate[] certificates, String type)
-
Field Details
-
logger
Logging instance. -
DEFAULT
Default setting for trust level.
-
-
Constructor Details
-
ConfigurableX509TrustManager
-
ConfigurableX509TrustManager
public ConfigurableX509TrustManager(ConfigurableX509TrustManager.TrustLevel level) throws NoSuchAlgorithmException, KeyStoreException Constructor.- Parameters:
level- Level of trust to effect.- Throws:
NoSuchAlgorithmExceptionKeyStoreException
-
-
Method Details
-
checkClientTrusted
public void checkClientTrusted(X509Certificate[] certificates, String type) throws CertificateException - Specified by:
checkClientTrustedin interfaceX509TrustManager- Throws:
CertificateException
-
checkServerTrusted
public void checkServerTrusted(X509Certificate[] certificates, String type) throws CertificateException - Specified by:
checkServerTrustedin interfaceX509TrustManager- Throws:
CertificateException
-
getAcceptedIssuers
- Specified by:
getAcceptedIssuersin interfaceX509TrustManager
-