-
Notifications
You must be signed in to change notification settings - Fork 24.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Access SSL contexts using names instead of Settings #30953
Merged
Merged
Changes from 20 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
8fbe6e1
Refer to SSL contexts by name not settings
tvernum 222015b
Merge branch 'master' into fix/30344-ssl-context-names
tvernum a360d22
[WIP] Use named SSL context in LDAP
tvernum 29077e2
Merge branch 'master' into fix/30344-ssl-context-names
tvernum 9ea7a52
Update openldap QA tests for named SSL contexts
tvernum 997a1ec
Remove sslSocketFactory(Settings) from SSLService
tvernum 2999649
Deprecate createSSLEngine(Settings)
tvernum bcde8a5
Remove createSSLEngine(Settings)
tvernum 6ce4d32
Reduce use of Settings in SSL
tvernum f9cc028
Merge branch 'master' into fix/30344-ssl-context-names
tvernum e0561ee
Merge branch 'master' into fix/30344-ssl-context-names
tvernum bee987c
Improve SSLService tests
tvernum 7c060d7
Small cleanup
tvernum 2282d01
Merge branch 'master' into fix/30344-ssl-context-names
tvernum 1aa0c14
Add additional test for named SSL configurations
tvernum 39e6629
Merge branch 'master' into fix/30344-ssl-context-names
tvernum ef58ff1
Merge branch 'master' into fix/30344-ssl-context-names
tvernum d94dd57
Merge branch 'master' into fix/30344-ssl-context-names
tvernum ee32357
Remove unused imports
tvernum 5a57fd6
Merge branch 'master' into fix/30344-ssl-context-names
tvernum cf2fdf0
Merge branch 'master' into fix/30344-ssl-context-names
tvernum 42e3aa1
Fix test (feedback)
tvernum fb0505e
Merge branch 'master' into fix/30344-ssl-context-names
tvernum 37cc028
Merge branch 'master' into fix/30344-ssl-context-names
tvernum 817c565
Merge branch 'master' into fix/30344-ssl-context-names
tvernum 2eb845a
Fix monitoring to work with dynamic SSL settings
tvernum 2f6c87b
Merge branch 'master' into fix/30344-ssl-context-names
tvernum 255a42e
Cleanup test static vars
tvernum 8ea7e35
Address feedback from @jaymode (round 1)
tvernum e8d8299
Fix import
tvernum b11d61b
Rename test & context name
tvernum f4bab91
Remove more uses of sslConfiguration from settings
tvernum f637dc7
Merge branch 'master' into fix/30344-ssl-context-names
tvernum f774e6d
Remove remaining uses of deprecated methods
tvernum d1f3147
Don't use JKS keystore in test
tvernum 44c4cf1
Fix broken test
tvernum 9a0c026
Merge branch 'master' into fix/30344-ssl-context-names
tvernum bc3095e
Fix broken tests
tvernum 9f6fa6d
Merge branch 'master' into fix/30344-ssl-context-names
tvernum File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
159 changes: 88 additions & 71 deletions
159
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ssl/SSLService.java
Large diffs are not rendered by default.
Oops, something went wrong.
161 changes: 134 additions & 27 deletions
161
x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ssl/SSLServiceTests.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ | |
import org.elasticsearch.xpack.core.TestXPackTransportClient; | ||
import org.elasticsearch.xpack.core.XPackSettings; | ||
import org.elasticsearch.xpack.core.common.socket.SocketAccess; | ||
import org.elasticsearch.xpack.core.ssl.SSLConfiguration; | ||
import org.elasticsearch.xpack.core.ssl.SSLService; | ||
import org.elasticsearch.xpack.security.LocalStateSecurity; | ||
|
||
|
@@ -121,8 +122,9 @@ public void testThatConnectionToHTTPWorks() throws Exception { | |
CredentialsProvider provider = new BasicCredentialsProvider(); | ||
provider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(nodeClientUsername(), | ||
new String(nodeClientPassword().getChars()))); | ||
SSLConfiguration sslConfiguration = service.sslConfiguration(Settings.EMPTY, Settings.EMPTY); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we still have these methods? It seems like this just asks for programming mistakes |
||
try (CloseableHttpClient client = HttpClients.custom() | ||
.setSSLSocketFactory(new SSLConnectionSocketFactory(service.sslSocketFactory(Settings.EMPTY), | ||
.setSSLSocketFactory(new SSLConnectionSocketFactory(service.sslSocketFactory(sslConfiguration), | ||
SSLConnectionSocketFactory.getDefaultHostnameVerifier())) | ||
.setDefaultCredentialsProvider(provider).build(); | ||
CloseableHttpResponse response = SocketAccess.doPrivileged(() -> client.execute(new HttpGet(getNodeUrl())))) { | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_global
->xpack.ssl