Package org.apache.commons.net.util
Class TrustManagerUtils
java.lang.Object
org.apache.commons.net.util.TrustManagerUtils
TrustManager utilities for generating TrustManagers.
- Since:
- 3.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic X509TrustManagerGenerate a TrustManager that performs no checks.static X509TrustManagergetDefaultTrustManager(KeyStore keyStore) Return the default TrustManager provided by the JVM.static X509TrustManagerGenerate a TrustManager that checks server certificates for validity, but otherwise performs no checks.
-
Constructor Details
-
TrustManagerUtils
Deprecated.Will be removed in 2.0.Depreacted.
-
-
Method Details
-
getAcceptAllTrustManager
Generate a TrustManager that performs no checks.- Returns:
- the TrustManager
-
getDefaultTrustManager
public static X509TrustManager getDefaultTrustManager(KeyStore keyStore) throws GeneralSecurityException Return the default TrustManager provided by the JVM.This should be the same as the default used by
SSLContext#init(KeyManager[], TrustManager[], SecureRandom)when the TrustManager parameter is set tonull- Parameters:
keyStore- the KeyStore to use, may benull- Returns:
- the default TrustManager
- Throws:
GeneralSecurityException- if an error occurs
-
getValidateServerCertificateTrustManager
Generate a TrustManager that checks server certificates for validity, but otherwise performs no checks.- Returns:
- the validating TrustManager
-