Package org.apache.ofbiz.base.util
Class SSLUtil
- java.lang.Object
-
- org.apache.ofbiz.base.util.SSLUtil
-
public final class SSLUtil extends java.lang.Object
KeyStoreUtil - Utilities for setting up SSL connections with specific client certificates
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getHostCertMinCheck()
static int
getHostCertNoCheck()
static int
getHostCertNormalCheck()
static javax.net.ssl.HostnameVerifier
getHostnameVerifier(int level)
static javax.net.ssl.KeyManager[]
getKeyManagers()
static javax.net.ssl.KeyManager[]
getKeyManagers(java.lang.String alias)
static javax.net.ssl.KeyManager[]
getKeyManagers(java.security.KeyStore ks, java.lang.String password, java.lang.String alias)
static javax.net.ssl.SSLContext
getSSLContext(java.lang.String alias, boolean trustAny)
static javax.net.ssl.SSLContext
getSSLContext(java.security.KeyStore ks, java.lang.String password, java.lang.String alias, boolean trustAny)
static javax.net.ssl.SSLServerSocketFactory
getSSLServerSocketFactory(java.lang.String alias)
static javax.net.ssl.SSLServerSocketFactory
getSSLServerSocketFactory(java.security.KeyStore ks, java.lang.String password, java.lang.String alias)
static javax.net.ssl.SSLSocketFactory
getSSLSocketFactory()
static javax.net.ssl.SSLSocketFactory
getSSLSocketFactory(java.lang.String alias)
static javax.net.ssl.SSLSocketFactory
getSSLSocketFactory(java.lang.String alias, boolean trustAny)
static javax.net.ssl.SSLSocketFactory
getSSLSocketFactory(java.security.KeyStore ks, java.lang.String password, java.lang.String alias)
static javax.net.ssl.TrustManager[]
getTrustAnyManagers()
static javax.net.ssl.TrustManager[]
getTrustManagers()
static javax.net.ssl.TrustManager[]
getTrustManagers(java.security.KeyStore ks)
static boolean
isClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)
static void
loadJsseProperties()
static void
loadJsseProperties(boolean debug)
-
-
-
Method Detail
-
getHostCertNoCheck
public static int getHostCertNoCheck()
-
getHostCertMinCheck
public static int getHostCertMinCheck()
-
getHostCertNormalCheck
public static int getHostCertNormalCheck()
-
isClientTrusted
public static boolean isClientTrusted(java.security.cert.X509Certificate[] chain, java.lang.String authType)
-
getKeyManagers
public static javax.net.ssl.KeyManager[] getKeyManagers(java.lang.String alias) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getKeyManagers
public static javax.net.ssl.KeyManager[] getKeyManagers() throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getTrustManagers
public static javax.net.ssl.TrustManager[] getTrustManagers() throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getTrustAnyManagers
public static javax.net.ssl.TrustManager[] getTrustAnyManagers()
-
getKeyManagers
public static javax.net.ssl.KeyManager[] getKeyManagers(java.security.KeyStore ks, java.lang.String password, java.lang.String alias) throws java.security.GeneralSecurityException
- Throws:
java.security.GeneralSecurityException
-
getTrustManagers
public static javax.net.ssl.TrustManager[] getTrustManagers(java.security.KeyStore ks)
-
getSSLSocketFactory
public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.security.KeyStore ks, java.lang.String password, java.lang.String alias) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getSSLContext
public static javax.net.ssl.SSLContext getSSLContext(java.security.KeyStore ks, java.lang.String password, java.lang.String alias, boolean trustAny) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getSSLSocketFactory
public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.lang.String alias, boolean trustAny) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getSSLContext
public static javax.net.ssl.SSLContext getSSLContext(java.lang.String alias, boolean trustAny) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getSSLSocketFactory
public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory(java.lang.String alias) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getSSLSocketFactory
public static javax.net.ssl.SSLSocketFactory getSSLSocketFactory() throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getSSLServerSocketFactory
public static javax.net.ssl.SSLServerSocketFactory getSSLServerSocketFactory(java.security.KeyStore ks, java.lang.String password, java.lang.String alias) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getSSLServerSocketFactory
public static javax.net.ssl.SSLServerSocketFactory getSSLServerSocketFactory(java.lang.String alias) throws java.io.IOException, java.security.GeneralSecurityException, GenericConfigException
- Throws:
java.io.IOException
java.security.GeneralSecurityException
GenericConfigException
-
getHostnameVerifier
public static javax.net.ssl.HostnameVerifier getHostnameVerifier(int level)
-
loadJsseProperties
public static void loadJsseProperties()
-
loadJsseProperties
public static void loadJsseProperties(boolean debug)
-
-