Skip to content
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

RestClient should use system properties for SSL #23231

Closed
jaymode opened this issue Feb 17, 2017 · 2 comments
Closed

RestClient should use system properties for SSL #23231

jaymode opened this issue Feb 17, 2017 · 2 comments
Assignees
Labels
:Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch >enhancement

Comments

@jaymode
Copy link
Member

jaymode commented Feb 17, 2017

The RestClient uses the Apache HttpAsyncClient internally, which does not obey the JVM system defaults for SSL but rather configures its own defaults as documented in the builder's javadocs. This has an effect on reindex as it uses the RestClient internally and cannot be easily configured to trust different certificates by using the JVM's default system properties.

I think the RestClient should default to use system properties and in turn this would also enable reindex to be configured using the JVM defaults.

@jaymode jaymode added :Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch discuss labels Feb 17, 2017
@Jingw98
Copy link

Jingw98 commented Mar 22, 2017

I will try to fix this if it's OK :)

Jingw98 pushed a commit to Jingw98/elasticsearch that referenced this issue Mar 22, 2017
Jingw98 pushed a commit to Jingw98/elasticsearch that referenced this issue Mar 22, 2017
* RestClientBuilder.java: use method - SystemProperties() to apply system properties in th Rest Client.
* RestClientBuilderTest: add new test - testSetSystemProperties() to test if the Rest Client is actully using system properties.

TODO: Add detail comments
kblincoe added a commit to kblincoe/elasticsearch that referenced this issue Apr 3, 2017
@jkelastic
Copy link

@ppf2 thanks :D

@jaymode jaymode self-assigned this Jul 17, 2017
@jaymode jaymode removed the help wanted adoptme label Jul 17, 2017
jaymode added a commit to jaymode/elasticsearch that referenced this issue Jul 17, 2017
This commit calls the `useSystemProperties` method on the HttpAsyncClientBuilder so that the jvm
system properties are used. The primary reason for doing this is to ensure the builder uses the
system default SSLContext rather than the default instance created by the http client library.

Closes elastic#23231
jaymode added a commit that referenced this issue Jul 20, 2017
This commit calls the `useSystemProperties` method on the HttpAsyncClientBuilder so that the jvm
system properties are used. The primary reason for doing this is to ensure the builder uses the
system default SSLContext rather than the default instance created by the http client library.

Closes #23231
jaymode added a commit that referenced this issue Jul 20, 2017
This commit calls the `useSystemProperties` method on the HttpAsyncClientBuilder so that the jvm
system properties are used. The primary reason for doing this is to ensure the builder uses the
system default SSLContext rather than the default instance created by the http client library.

Closes #23231
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Clients/Java Low Level REST Client Minimal dependencies Java Client for Elasticsearch >enhancement
Projects
None yet
Development

No branches or pull requests

4 participants