|
31 | 31 | import org.elasticsearch.common.settings.Setting; |
32 | 32 | import org.elasticsearch.common.settings.Settings; |
33 | 33 | import org.elasticsearch.common.ssl.SslClientAuthenticationMode; |
34 | | -import org.elasticsearch.common.ssl.SslConfiguration; |
35 | 34 | import org.elasticsearch.common.transport.TransportAddress; |
36 | 35 | import org.elasticsearch.common.unit.ByteSizeValue; |
37 | 36 | import org.elasticsearch.common.util.PageCacheRecycler; |
|
66 | 65 | import org.elasticsearch.xpack.core.XPackSettings; |
67 | 66 | import org.elasticsearch.xpack.core.common.socket.SocketAccess; |
68 | 67 | import org.elasticsearch.xpack.core.ssl.SSLService; |
| 68 | +import org.elasticsearch.xpack.core.ssl.SslProfile; |
69 | 69 | import org.elasticsearch.xpack.security.authc.CrossClusterAccessAuthenticationService; |
70 | 70 | import org.elasticsearch.xpack.security.transport.SSLEngineUtils; |
71 | 71 | import org.elasticsearch.xpack.security.transport.filter.IPFilter; |
@@ -215,8 +215,8 @@ public void testRenegotiation() throws Exception { |
215 | 215 | SSLService sslService = createSSLService( |
216 | 216 | Settings.builder().put("xpack.security.transport.ssl.supported_protocols", "TLSv1.2").build() |
217 | 217 | ); |
218 | | - final SslConfiguration sslConfiguration = sslService.getSSLConfiguration("xpack.security.transport.ssl"); |
219 | | - SocketFactory factory = sslService.sslSocketFactory(sslConfiguration); |
| 218 | + final SslProfile sslProfile = sslService.profile("xpack.security.transport.ssl"); |
| 219 | + final SocketFactory factory = sslProfile.socketFactory(); |
220 | 220 | try (SSLSocket socket = (SSLSocket) factory.createSocket()) { |
221 | 221 | SocketAccess.doPrivileged(() -> socket.connect(serviceA.boundAddress().publishAddress().address())); |
222 | 222 |
|
@@ -267,8 +267,8 @@ public void testSNIServerNameIsPropagated() throws Exception { |
267 | 267 | assumeFalse("Can't run in a FIPS JVM, TrustAllConfig is not a SunJSSE TrustManagers", inFipsJvm()); |
268 | 268 | SSLService sslService = createSSLService(); |
269 | 269 |
|
270 | | - final SslConfiguration sslConfiguration = sslService.getSSLConfiguration("xpack.security.transport.ssl"); |
271 | | - SSLContext sslContext = sslService.sslContext(sslConfiguration); |
| 270 | + final SslProfile sslProfile = sslService.profile("xpack.security.transport.ssl"); |
| 271 | + final SSLContext sslContext = sslProfile.sslContext(); |
272 | 272 | final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); |
273 | 273 | final String sniIp = "sni-hostname"; |
274 | 274 | final SNIHostName sniHostName = new SNIHostName(sniIp); |
@@ -332,8 +332,8 @@ public void testInvalidSNIServerName() throws Exception { |
332 | 332 | assumeFalse("Can't run in a FIPS JVM, TrustAllConfig is not a SunJSSE TrustManagers", inFipsJvm()); |
333 | 333 | SSLService sslService = createSSLService(); |
334 | 334 |
|
335 | | - final SslConfiguration sslConfiguration = sslService.getSSLConfiguration("xpack.security.transport.ssl"); |
336 | | - SSLContext sslContext = sslService.sslContext(sslConfiguration); |
| 335 | + final SslProfile sslProfile = sslService.profile("xpack.security.transport.ssl"); |
| 336 | + final SSLContext sslContext = sslProfile.sslContext(); |
337 | 337 | final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); |
338 | 338 | final String sniIp = "invalid_hostname"; |
339 | 339 |
|
@@ -859,8 +859,8 @@ public void testTcpHandshakeTimeout() throws IOException { |
859 | 859 | assumeFalse("Can't run in a FIPS JVM, TrustAllConfig is not a SunJSSE TrustManagers", inFipsJvm()); |
860 | 860 | SSLService sslService = createSSLService(); |
861 | 861 |
|
862 | | - final SslConfiguration sslConfiguration = sslService.getSSLConfiguration("xpack.security.transport.ssl"); |
863 | | - SSLContext sslContext = sslService.sslContext(sslConfiguration); |
| 862 | + final SslProfile sslProfile = sslService.profile("xpack.security.transport.ssl"); |
| 863 | + final SSLContext sslContext = sslProfile.sslContext(); |
864 | 864 | final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); |
865 | 865 | // use latch to to ensure that the accepted socket below isn't closed before the handshake times out |
866 | 866 | final CountDownLatch doneLatch = new CountDownLatch(1); |
@@ -996,8 +996,8 @@ public void testTcpHandshakeConnectionReset() throws IOException, InterruptedExc |
996 | 996 | assumeFalse("Can't run in a FIPS JVM, TrustAllConfig is not a SunJSSE TrustManagers", inFipsJvm()); |
997 | 997 | SSLService sslService = createSSLService(); |
998 | 998 |
|
999 | | - final SslConfiguration sslConfiguration = sslService.getSSLConfiguration("xpack.security.transport.ssl"); |
1000 | | - SSLContext sslContext = sslService.sslContext(sslConfiguration); |
| 999 | + final SslProfile sslProfile = sslService.profile("xpack.security.transport.ssl"); |
| 1000 | + final SSLContext sslContext = sslProfile.sslContext(); |
1001 | 1001 | final SSLServerSocketFactory serverSocketFactory = sslContext.getServerSocketFactory(); |
1002 | 1002 | try (ServerSocket socket = serverSocketFactory.createServerSocket()) { |
1003 | 1003 | socket.bind(getLocalEphemeral(), 1); |
|
0 commit comments