Search in sources :

Example 16 with SslContextFactory

use of org.apache.ignite.ssl.SslContextFactory in project ignite by apache.

the class JdbcThinConnectionSSLTest method getTestSslContextFactory.

/**
 * @return Test SSL context factory.
 */
private static Factory<SSLContext> getTestSslContextFactory() {
    SslContextFactory factory = new SslContextFactory();
    factory.setCipherSuites(supportedCiphers);
    factory.setKeyStoreFilePath(SRV_KEY_STORE_PATH);
    factory.setKeyStorePassword("123456".toCharArray());
    factory.setTrustStoreFilePath(TRUST_KEY_STORE_PATH);
    factory.setTrustStorePassword("123456".toCharArray());
    return factory;
}
Also used : SslContextFactory(org.apache.ignite.ssl.SslContextFactory)

Example 17 with SslContextFactory

use of org.apache.ignite.ssl.SslContextFactory in project ignite by apache.

the class CommonSecurityCheckTest method getClientSslContextFactory.

/**
 * @return SSL context factory for clients.
 */
@NotNull
protected SslContextFactory getClientSslContextFactory() {
    SslContextFactory sslFactory = (SslContextFactory) GridTestUtils.sslFactory();
    sslFactory.setKeyStoreFilePath(U.resolveIgnitePath(GridTestProperties.getProperty("ssl.keystore.client.path")).getAbsolutePath());
    return sslFactory;
}
Also used : SslContextFactory(org.apache.ignite.ssl.SslContextFactory) NotNull(org.jetbrains.annotations.NotNull)

Example 18 with SslContextFactory

use of org.apache.ignite.ssl.SslContextFactory in project ignite by apache.

the class SslParametersTest method createSslFactory.

/**
 * @return SSL factory.
 */
@NotNull
private SslContextFactory createSslFactory() {
    SslContextFactory factory = (SslContextFactory) GridTestUtils.sslTrustedFactory("node01", "trustone");
    factory.setCipherSuites(cipherSuites);
    factory.setProtocols(protocols);
    return factory;
}
Also used : SslContextFactory(org.apache.ignite.ssl.SslContextFactory) NotNull(org.jetbrains.annotations.NotNull)

Example 19 with SslContextFactory

use of org.apache.ignite.ssl.SslContextFactory in project ignite by apache.

the class GridTestUtils method sslFactory.

/**
 * Creates test-purposed SSL context factory from test key store with disabled trust manager.
 *
 * @return SSL context factory used in test.
 */
public static Factory<SSLContext> sslFactory() {
    SslContextFactory factory = new SslContextFactory();
    factory.setKeyStoreFilePath(U.resolveIgnitePath(GridTestProperties.getProperty("ssl.keystore.path")).getAbsolutePath());
    factory.setKeyStorePassword(keyStorePassword().toCharArray());
    factory.setTrustManagers(SslContextFactory.getDisabledTrustManager());
    return factory;
}
Also used : SslContextFactory(org.apache.ignite.ssl.SslContextFactory) GridSslContextFactory(org.apache.ignite.internal.client.ssl.GridSslContextFactory)

Example 20 with SslContextFactory

use of org.apache.ignite.ssl.SslContextFactory in project ignite by apache.

the class DiscoveryClientSocketTest method before.

/**
 * Configure SSL and Discovery.
 */
@Before
public void before() {
    SslContextFactory socketFactory = (SslContextFactory) GridTestUtils.sslTrustedFactory("node01", "trustone");
    SSLContext sslCtx = socketFactory.create();
    sslSrvSockFactory = sslCtx.getServerSocketFactory();
    sslSockFactory = sslCtx.getSocketFactory();
    fakeTcpDiscoverySpi = new TcpDiscoverySpi();
    fakeTcpDiscoverySpi.setSoLinger(1);
}
Also used : SslContextFactory(org.apache.ignite.ssl.SslContextFactory) SSLContext(javax.net.ssl.SSLContext) Before(org.junit.Before)

Aggregations

SslContextFactory (org.apache.ignite.ssl.SslContextFactory)21 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)6 NotNull (org.jetbrains.annotations.NotNull)4 ClientConnectorConfiguration (org.apache.ignite.configuration.ClientConnectorConfiguration)3 SSLContext (javax.net.ssl.SSLContext)2 GridSslContextFactory (org.apache.ignite.internal.client.ssl.GridSslContextFactory)2 Before (org.junit.Before)2 Test (org.junit.jupiter.api.Test)2 Paths (java.nio.file.Paths)1 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)1 SQLException (java.sql.SQLException)1 SimpleEntry (java.util.AbstractMap.SimpleEntry)1 ExecutionException (java.util.concurrent.ExecutionException)1 Consumer (java.util.function.Consumer)1 Function (java.util.function.Function)1 Factory (javax.cache.configuration.Factory)1 SSLException (javax.net.ssl.SSLException)1 SSLSocketFactory (javax.net.ssl.SSLSocketFactory)1 ToString (lombok.ToString)1 lombok.val (lombok.val)1