Class SSLSocketFactory
java.lang.Object
ecmwf.common.security.SSLSocketFactory
-
Method Summary
Modifier and TypeMethodDescriptionstatic KeyManager[]getKeyManagers(String keyStorePath, String keyStorePass, String keyStoreType, String keyStoreAlgorithm) Gets the key managers.static SSLContextGets the SSL context.static SSLContextgetSSLContext(TrustManager[] trustManagers, KeyManager[] keyManagers) Gets the SSL context.static ServerSocketFactoryGets the SSL server socket factory.static SocketFactoryGets the SSL socket factory.static TrustManager[]getTrustManagers(String trustStorePath, String trustStorePass, String trustStoreType, String trustStoreAlgorithm) Gets the trust managers.static voidSets the https url connection trust all certs.
-
Method Details
-
getSSLServerSocketFactory
Gets the SSL server socket factory.- Returns:
- the SSL server socket factory
-
getSSLSocketFactory
Gets the SSL socket factory.- Returns:
- the SSL socket factory
-
getSSLContext
Gets the SSL context.- Returns:
- the SSL context
- Throws:
KeyManagementException- the key management exceptionNoSuchAlgorithmException- the no such algorithm exception
-
getSSLContext
public static SSLContext getSSLContext(TrustManager[] trustManagers, KeyManager[] keyManagers) throws NoSuchAlgorithmException, KeyManagementException Gets the SSL context.- Parameters:
trustManagers- the trust managerskeyManagers- the key managers- Returns:
- the SSL context
- Throws:
NoSuchAlgorithmException- the no such algorithm exceptionKeyManagementException- the key management exception
-
getTrustManagers
public static TrustManager[] getTrustManagers(String trustStorePath, String trustStorePass, String trustStoreType, String trustStoreAlgorithm) Gets the trust managers.- Parameters:
trustStorePath- the trust store pathtrustStorePass- the trust store passtrustStoreType- the trust store typetrustStoreAlgorithm- the trust store algorithm- Returns:
- the trust managers
-
getKeyManagers
public static KeyManager[] getKeyManagers(String keyStorePath, String keyStorePass, String keyStoreType, String keyStoreAlgorithm) Gets the key managers.- Parameters:
keyStorePath- the key store pathkeyStorePass- the key store passkeyStoreType- the key store typekeyStoreAlgorithm- the key store algorithm- Returns:
- the key managers
-
setHttpsURLConnectionTrustAllCerts
public static void setHttpsURLConnectionTrustAllCerts() throws NoSuchAlgorithmException, KeyManagementExceptionSets the https url connection trust all certs.- Throws:
NoSuchAlgorithmException- the no such algorithm exceptionKeyManagementException- the key management exception
-