I'm using ES and Kibana 5.1.2 (with x-pack) and have configured a Watcher to send an alert to Slack. The Watcher and query is working but the following error is generated in ES when trying to send the message to Slack:
[2017-02-01T16:55:47,613][ERROR][o.e.x.n.s.SlackService ] [IODOv55] failed to execute slack api http request
javax.net.ssl.SSLException: java.security.ProviderException: java.security.KeyException
at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) ~[?:?]
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1949) ~[?:?]
at sun.security.ssl.SSLSocketImpl.fatal(SSLSocketImpl.java:1906) ~[?:?]
at sun.security.ssl.SSLSocketImpl.handleException(SSLSocketImpl.java:1889) ~[?:?]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1410) ~[?:?]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1387) ~[?:?]
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559) ~[?:?]
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1283) ~[?:?]
at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1258) ~[?:?]
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250) ~[?:?]
at org.elasticsearch.xpack.common.http.HttpClient.doExecute(HttpClient.java:160) ~[x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.common.http.HttpClient.execute(HttpClient.java:90) ~[x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.notification.slack.SlackAccount.send(SlackAccount.java:123) [x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.notification.slack.SlackAccount.send(SlackAccount.java:78) [x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.watcher.actions.slack.ExecutableSlackAction.execute(ExecutableSlackAction.java:65) [x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.watcher.actions.ActionWrapper.execute(ActionWrapper.java:158) [x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.watcher.execution.ExecutionService.executeInner(ExecutionService.java:415) [x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.watcher.execution.ExecutionService.execute(ExecutionService.java:275) [x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.xpack.watcher.execution.ExecutionService$WatchExecutionTask.run(ExecutionService.java:496) [x-pack-5.1.2.jar:5.1.2]
at org.elasticsearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:458) [elasticsearch-5.1.2.jar:5.1.2]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_101]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_101]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.security.ProviderException: java.security.KeyException
at sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:147) ~[?:?]
at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:703) ~[?:1.8.0_101]
at sun.security.ssl.ECDHCrypt.(ECDHCrypt.java:77) ~[?:?]
at sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:721) ~[?:?]
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:281) ~[?:?]
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) ~[?:?]
at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) ~[?:?]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) ~[?:?]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) ~[?:?]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) ~[?:?]
... 19 more
Caused by: java.security.KeyException
at sun.security.ec.ECKeyPairGenerator.generateECKeyPair(Native Method) ~[?:?]
at sun.security.ec.ECKeyPairGenerator.generateKeyPair(ECKeyPairGenerator.java:128) ~[?:?]
at java.security.KeyPairGenerator$Delegate.generateKeyPair(KeyPairGenerator.java:703) ~[?:1.8.0_101]
at sun.security.ssl.ECDHCrypt.(ECDHCrypt.java:77) ~[?:?]
at sun.security.ssl.ClientHandshaker.serverKeyExchange(ClientHandshaker.java:721) ~[?:?]
at sun.security.ssl.ClientHandshaker.processMessage(ClientHandshaker.java:281) ~[?:?]
at sun.security.ssl.Handshaker.processLoop(Handshaker.java:979) ~[?:?]
at sun.security.ssl.Handshaker.process_record(Handshaker.java:914) ~[?:?]
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1062) ~[?:?]
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1375) ~[?:?]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1403) ~[?:?]
This is my ES yml file, and as I thought it may be some issue with the security I just disabled as many of those settings as I thought appropriate, as you can see by the lines appended to the end:
which java version are you using? How did you install that one (package, repo, etc)? And lastly what Linux distribution (plus version if possible) is this running on?
Thanks for your response, and here are the details as requested:
[oracle@dbvrep01 elasticsearch-5.1.2]$ cat /etc/*-release
Oracle Linux Server release 6.3
Red Hat Enterprise Linux Server release 6.3 (Santiago)
Oracle Linux Server release 6.3
[oracle@dbvrep01 elasticsearch-5.1.2]$ uname -a
Linux dbvrep01 2.6.32-279.14.1.el6.x86_64 #1 SMP Tue Nov 6 11:18:01 PST 2012 x86_64 x86_64 x86_64 GNU/Linux
Java:
[oracle@dbvrep01 elasticsearch-5.1.2]$ java -version
openjdk version "1.8.0_101"
OpenJDK Runtime Environment (build 1.8.0_101-b13)
OpenJDK 64-Bit Server VM (build 25.101-b13, mixed mode)
Did the offline install of x-pack with the zip file, as outlined in the following:
what is returned when you run curl -v https://hooks.slack.com ; echo $?
I do not know much about oracle, but ubuntu has a ca-certificates-java package, that includes a bunch of certs that are needed to connect to certain hosts. Is Oracle Linux having something similar?
To be honest I'm not sure about those certificates you mention on OEL...it's something I can look into, but if I run the command you supplied it seems to execute correctly:
I have the feeling that you are missing certificate authority certs in your default system keystore/truststore. Can you test with an oracle java version and report back?
The same issue is happening to me. I have the same configuration as miked and I am using OpenJDK, but when I execute curl -v https://hooks.slack.com ; echo $?, it shows the certificate as on last answer.
Is it mandatory to use Oracle JDK, or is there something I need to check?
@miked so apparently every openJDK packager (like the distributions) is free to choose what to put into the distribution. So even same openjdk versions from different distributions can contain different cacerts resulting in error messages from above.
I will add some paragraphs to the x-pack docs regarding that.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.