-
Notifications
You must be signed in to change notification settings - Fork 0
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
http://cinhtau.net/2018/06/07/encrypted-communication-elasticsearch-java-rest-client/ #5
Comments
Hi, Thanks in advance. |
@ayushmathur86 - It is written in the article.
The format p12 does not matter. You can import with keytool the p12 format or just copy contents form keystore to keystore. See https://cinhtau.net/2016/03/11/copy-contents-of-java-keystore-to-another-keystore/ If the certs are in the keystore, just rename |
@cinhtau thank you for your reply. How those can be generated from P12 self signed certs generated from certutil utility of Elasticsearch ? |
@ayushmathur86 Can you tell me what you are trying to do? What command doesn't work for you? Do you see the contents of this keystore? keytool -list -keystore <your-key-storename.jks> From version 6.1 to 6.2, Elastic switch its certificate format from cert to p12. If you have the p12 certs just import them in p12 format. An example: keytool -importkeystore \
-deststorepass [password] \
-destkeystore [filename-new-keystore.jks] \
-srckeystore [filename-new-PKCS-12.p12] \
-srcstoretype PKCS12 |
@cinhtau Currently the http.ssl and transport.ssl is configured to use p12 certificates on Elasticsearch, but in your case here, you're using PEM formatted ones.
|
Ahh, nevermind about 2nd point, I sorted out -srcstorepass should have been provided for blank/no passwords. |
@ayushmathur86 Can you describe what you have tried with See also https://www.elastic.co/guide/en/elasticsearch/reference/6.2/certutil.html |
@cinhtau I have used just 2 commands to create my CA and node certificate: From the link you mentioned, for Cert mode: |
Also, if I will create those PEM format certificates, can I use the same set for Kibana and Fluentd which use PEM format again ? |
The idea behind self signed certs is you have the root ca. For each participant (client or server), you generate for each particpants its own certificate. Since your root ca issued the certificate, you can trust the certificate. Kibana and fluentd should get their own certificates. Generate for each its own certificate. Using one PEM for all clients is not recommended. Regardless what you generate with certutil, you can always convert p12 to pem and vice versa. Look for |
Thank you @cinhtau. |
@ayushmathur86 What is your command on the terminal/shell, when you start the Java Application? You don't need a private key in a trust store. I strongly advise against it. From my understanding, you have a client who wants to access Elasticsearch?
You need the certificate of the Elasticsearch Server and the public ca, in order to establish a connection. |
@cinhtau thank you for guiding me through the steps. I'm now able to connect with Elastic using https scheme by following your blog, 3 cheers for that :) ! |
@ayushmathur86 Can you check with curl? curl -k -u <your-username> https://localhost:9200 |
Hi,
Already tried curl with that user and works fine.
Looks like I had to include auth interceptor to pass the creds despite the
fact I was using CredentialProvider in SSL Async Configurer.
It's working fine now and I'm able to connect and search for logs in my
citrus client.
Thanks a ton for helping me out :)
…On Tue, Aug 27, 2019, 19:04 Tan-Vinh Nguyen ***@***.***> wrote:
@ayushmathur86 <https://github.com/ayushmathur86> 401is a http code, that
tell you either your user or password is wrong. Maybe both.
Can you check with curl?
Add the -k option to ignore the SSL certificate.
curl -k -u <your-username> https://localhost:9200
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5?email_source=notifications&email_token=ACVUDQIP564AXP7BFESMPFTQGVF7TA5CNFSM4IPBSDD2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5IIFQQ#issuecomment-525370050>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACVUDQI7XJ5ZZFRLZPWKC5LQGVF7TANCNFSM4IPBSDDQ>
.
|
Hi I tried all the above steps but getting the below excpetion |
Encrypted Communication with the Elasticsearch Java Rest Client
Elasticsearch with the X-Pack extensions allows you to secure the communication with your Elasticsearch cluster. This post elaborates what actions are needed...
http://cinhtau.net/2018/06/07/encrypted-communication-elasticsearch-java-rest-client/
The text was updated successfully, but these errors were encountered: