Search in sources :

Example 1 with RemoteTransportException

use of akka.remote.RemoteTransportException in project flink by apache.

the class CustomSSLEngineProvider method trustManagers.

@Override
public TrustManager[] trustManagers() {
    try {
        final TrustManagerFactory trustManagerFactory = sslCertFingerprints.isEmpty() ? TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()) : FingerprintTrustManagerFactory.builder("SHA1").fingerprints(sslCertFingerprints).build();
        trustManagerFactory.init(loadKeystore(sslTrustStore, sslTrustStorePassword));
        return trustManagerFactory.getTrustManagers();
    } catch (GeneralSecurityException e) {
        // replicate exception handling from SSLEngineProvider
        throw new RemoteTransportException("Server SSL connection could not be established because SSL context could not be constructed", e);
    }
}
Also used : RemoteTransportException(akka.remote.RemoteTransportException) TrustManagerFactory(javax.net.ssl.TrustManagerFactory) FingerprintTrustManagerFactory(org.apache.flink.shaded.netty4.io.netty.handler.ssl.util.FingerprintTrustManagerFactory) GeneralSecurityException(java.security.GeneralSecurityException)

Aggregations

RemoteTransportException (akka.remote.RemoteTransportException)1 GeneralSecurityException (java.security.GeneralSecurityException)1 TrustManagerFactory (javax.net.ssl.TrustManagerFactory)1 FingerprintTrustManagerFactory (org.apache.flink.shaded.netty4.io.netty.handler.ssl.util.FingerprintTrustManagerFactory)1