|
6 | 6 | */ |
7 | 7 | package org.elasticsearch.xpack.core.ssl; |
8 | 8 |
|
9 | | -import org.apache.http.HttpHost; |
10 | 9 | import org.apache.http.conn.ssl.DefaultHostnameVerifier; |
11 | 10 | import org.apache.http.conn.ssl.NoopHostnameVerifier; |
12 | 11 | import org.apache.http.conn.ssl.SSLConnectionSocketFactory; |
13 | 12 | import org.apache.http.nio.conn.ssl.SSLIOSessionStrategy; |
14 | | -import org.apache.http.nio.reactor.IOSession; |
15 | 13 | import org.apache.logging.log4j.LogManager; |
16 | 14 | import org.apache.logging.log4j.Logger; |
17 | 15 | import org.elasticsearch.ElasticsearchException; |
18 | 16 | import org.elasticsearch.ElasticsearchSecurityException; |
19 | 17 | import org.elasticsearch.common.CheckedSupplier; |
20 | 18 | import org.elasticsearch.common.Strings; |
21 | | -import org.elasticsearch.common.logging.LoggerMessageFormat; |
22 | 19 | import org.elasticsearch.common.settings.Setting; |
23 | 20 | import org.elasticsearch.common.settings.Settings; |
24 | 21 | import org.elasticsearch.common.ssl.DiagnosticTrustManager; |
25 | 22 | import org.elasticsearch.common.ssl.KeyStoreUtil; |
26 | 23 | import org.elasticsearch.common.ssl.SslConfigException; |
27 | 24 | import org.elasticsearch.common.ssl.SslConfiguration; |
28 | | -import org.elasticsearch.common.ssl.SslDiagnostics; |
29 | 25 | import org.elasticsearch.common.ssl.SslKeyConfig; |
30 | 26 | import org.elasticsearch.common.ssl.SslTrustConfig; |
31 | 27 | import org.elasticsearch.common.util.Maps; |
|
43 | 39 | import java.security.KeyManagementException; |
44 | 40 | import java.security.KeyStore; |
45 | 41 | import java.security.NoSuchAlgorithmException; |
46 | | -import java.security.cert.Certificate; |
47 | | -import java.security.cert.X509Certificate; |
48 | 42 | import java.util.ArrayList; |
49 | 43 | import java.util.Arrays; |
50 | 44 | import java.util.Collection; |
|
68 | 62 | import javax.net.ssl.HostnameVerifier; |
69 | 63 | import javax.net.ssl.SSLContext; |
70 | 64 | import javax.net.ssl.SSLEngine; |
71 | | -import javax.net.ssl.SSLException; |
72 | 65 | import javax.net.ssl.SSLParameters; |
73 | | -import javax.net.ssl.SSLPeerUnverifiedException; |
74 | 66 | import javax.net.ssl.SSLSession; |
75 | 67 | import javax.net.ssl.SSLSessionContext; |
76 | 68 | import javax.net.ssl.SSLSocket; |
77 | 69 | import javax.net.ssl.SSLSocketFactory; |
78 | 70 | import javax.net.ssl.X509ExtendedKeyManager; |
79 | 71 | import javax.net.ssl.X509ExtendedTrustManager; |
80 | | -import javax.security.auth.x500.X500Principal; |
81 | 72 |
|
82 | 73 | import static org.elasticsearch.transport.RemoteClusterPortSettings.REMOTE_CLUSTER_SERVER_ENABLED; |
83 | 74 | import static org.elasticsearch.xpack.core.XPackSettings.DEFAULT_SUPPORTED_PROTOCOLS; |
@@ -217,6 +208,12 @@ public static void registerSettings(List<Setting<?>> settingList) { |
217 | 208 | settingList.add(DIAGNOSE_TRUST_EXCEPTIONS_SETTING); |
218 | 209 | } |
219 | 210 |
|
| 211 | + /** |
| 212 | + * Return an encapsulated object for the named profile. |
| 213 | + * A profile is named according to the settings prefix under which it is defined (e.g. {@code xpack.http.ssl} or |
| 214 | + * {@code xpack.security.transport.ssl} |
| 215 | + * @throws IllegalArgumentException if the named profile does not exist |
| 216 | + */ |
220 | 217 | public SslProfile profile(String profileName) { |
221 | 218 | final SslConfiguration configuration = getSSLConfiguration(profileName); |
222 | 219 | if (configuration == null) { |
|
0 commit comments