"No certificates" error

361 views
Skip to first unread message

–Mic

unread,
Jul 10, 2017, 10:12:12 AM7/10/17
to Search Guard
Good afternoon folks!

I'm trying the  REST management API, but I've an error that I can't understand. This is the command I gave:

curl --cert /root/search-guard-certificates/client-certificates/CN\=sgadmin-crtfull.pem --key /root/search-guard-certificates/client-certificates/CN\=sgadmin.key.pem admin:admin@localhost:9200/_searchguard/api/user/admin

but the answer is:

No certificates

This could appear like I didn't passed any certs (and in facts, If i don't pass any certs, the answer is the same). But now: I pass it valid certificates, and I can't find all over the web an explanation of this error.
Can you help me please?
Thank you,

-Michele

SG

unread,
Jul 10, 2017, 1:48:49 PM7/10/17
to search...@googlegroups.com
seems to forgot to prepend https://

curl --cert /root/search-guard-certificates/client-certificates/CN\=sgadmin-crtfull.pem --key /root/search-guard-certificates/client-certificates/CN\=sgadmin.key.pem https://admin:admin@localhost:9200/_searchguard/api/user/admin
> --
> You received this message because you are subscribed to the Google Groups "Search Guard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to search-guard...@googlegroups.com.
> To post to this group, send email to search...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/search-guard/fef2f722-45ec-4f08-8d3b-0c274d65bed5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

–Mic

unread,
Jul 11, 2017, 5:28:04 AM7/11/17
to Search Guard
It worked, and I no longer received that error. Now BTW, I receive "curl: (35) Encountered end of file". I'm looking on google for suggestions... 

–Mic

unread,
Jul 11, 2017, 8:23:34 AM7/11/17
to Search Guard
** UPDATE **

With curl -vv option:

curl -vv --cert /root/search-guard-certificates/client-certificates/CN\=sgadmin.crtfull.pem --key /root/search-guard-certificates/client-certificates/CN\=sgadmin.key.pem https://admin:admin@localhost:9200/_searchguard/api/user/admin
* About to connect() to localhost port 9200 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9200 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
 
CApath: none
* NSS error -5938 (PR_END_OF_FILE_ERROR)
* Encountered end of file
* Closing connection 0

curl
: (35) Encountered end of file



I also checked Elasticsearch logs, which show this error whenever I send the curl request:

[2017-07-11 12:38:36,013][WARN ][http.netty               ] [node-1] Caught exception while handling client http traffic, closing connection [id: 0x7460fc66, /127.0.0.1:37954 => /127.0.0.1:9200]
java
.lang.IllegalArgumentException: invalid version format: Zᄉ~ᄁ{}VDヒ￙ᅦUDU6￀,￀
        at org
.jboss.netty.handler.codec.http.HttpVersion.<init>(HttpVersion.java:94)
        at org
.jboss.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:62)
        at org
.jboss.netty.handler.codec.http.HttpRequestDecoder.createMessage(HttpRequestDecoder.java:75)
        at org
.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:191)
        at org
.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:102)
        at org
.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:500)
        at org
.jboss.netty.handler.codec.replay.ReplayingDecoder.messageReceived(ReplayingDecoder.java:435)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:70)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:75)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
        at org
.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org
.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org
.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
        at org
.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
        at org
.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
        at org
.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
        at org
.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
        at org
.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org
.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java
.lang.Thread.run(Thread.java:745)
[2017-07-11 12:38:36,014][WARN ][http.netty               ] [node-1] Caught exception while handling client http traffic, closing connection [id: 0x7460fc66, /127.0.0.1:37954 :> /127.0.0.1:9200]
java
.lang.IllegalArgumentException: invalid version format: Zᄉ~ᄁ{}VDヒ￙ᅦUDU6￀,￀
        at org
.jboss.netty.handler.codec.http.HttpVersion.<init>(HttpVersion.java:94)
        at org
.jboss.netty.handler.codec.http.HttpVersion.valueOf(HttpVersion.java:62)
        at org
.jboss.netty.handler.codec.http.HttpRequestDecoder.createMessage(HttpRequestDecoder.java:75)
        at org
.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:191)
        at org
.jboss.netty.handler.codec.http.HttpMessageDecoder.decode(HttpMessageDecoder.java:102)
        at org
.jboss.netty.handler.codec.replay.ReplayingDecoder.callDecode(ReplayingDecoder.java:500)
        at org
.jboss.netty.handler.codec.replay.ReplayingDecoder.cleanup(ReplayingDecoder.java:554)
        at org
.jboss.netty.handler.codec.frame.FrameDecoder.channelDisconnected(FrameDecoder.java:365)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:75)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
        at org
.jboss.netty.channel.Channels.fireChannelDisconnected(Channels.java:396)
        at org
.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:360)
        at org
.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:81)
        at org
.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:36)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:779)
        at org
.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:54)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:784)
        at org
.jboss.netty.channel.SimpleChannelHandler.closeRequested(SimpleChannelHandler.java:334)
        at org
.jboss.netty.channel.SimpleChannelHandler.handleDownstream(SimpleChannelHandler.java:260)
        at org
.elasticsearch.http.netty.pipelining.HttpPipeliningHandler.handleDownstream(HttpPipeliningHandler.java:105)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
        at org
.jboss.netty.channel.Channels.close(Channels.java:812)
        at org
.jboss.netty.channel.AbstractChannel.close(AbstractChannel.java:205)
        at org
.elasticsearch.http.netty.NettyHttpServerTransport.exceptionCaught(NettyHttpServerTransport.java:467)
        at org
.elasticsearch.http.netty.HttpRequestHandler.exceptionCaught(HttpRequestHandler.java:67)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.jboss.netty.channel.SimpleChannelHandler.exceptionCaught(SimpleChannelHandler.java:156)
        at org
.jboss.netty.channel.SimpleChannelHandler.handleUpstream(SimpleChannelHandler.java:130)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.exceptionCaught(SimpleChannelUpstreamHandler.java:153)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.exceptionCaught(SimpleChannelUpstreamHandler.java:153)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.jboss.netty.handler.codec.frame.FrameDecoder.exceptionCaught(FrameDecoder.java:377)
        at org
.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:112)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:75)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
        at org
.jboss.netty.channel.Channels.fireExceptionCaught(Channels.java:525)
        at org
.jboss.netty.channel.AbstractChannelSink.exceptionCaught(AbstractChannelSink.java:48)
        at org
.jboss.netty.channel.DefaultChannelPipeline.notifyHandlerException(DefaultChannelPipeline.java:658)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:566)
        at org
.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
        at org
.elasticsearch.common.netty.OpenChannelsHandler.handleUpstream(OpenChannelsHandler.java:75)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
        at org
.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)
        at org
.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:268)
        at org
.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:255)
        at org
.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:88)
        at org
.jboss.netty.channel.socket.nio.AbstractNioWorker.process(AbstractNioWorker.java:108)
        at org
.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:337)
        at org
.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
        at org
.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
        at org
.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
        at org
.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
        at java
.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java
.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java
.lang.Thread.run(Thread.java:745)

I don't know how to go further.. any help?

SG

unread,
Jul 11, 2017, 10:27:28 AM7/11/17
to search...@googlegroups.com
pls post your elasticsearch.yml
> --
> You received this message because you are subscribed to the Google Groups "Search Guard" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to search-guard...@googlegroups.com.
> To post to this group, send email to search...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/search-guard/8e23992d-849e-4e45-aa20-0936600a0ca9%40googlegroups.com.
Message has been deleted

–Mic

unread,
Jul 11, 2017, 11:12:33 AM7/11/17
to Search Guard
Of course:

node.name: node-1
http
.port: 9200
searchguard
.ssl.transport.keystore_filepath: keystore.jks
searchguard
.ssl.transport.keystore_password: xxxxxxxxxxxx
searchguard
.ssl.transport.truststore_filepath: truststore.jks
searchguard
.ssl.transport.truststore_password: xxxxxxxxxxxx
searchguard
.ssl.transport.enforce_hostname_verification: false
searchguard
.authcz.admin_dn:
 
- CN=sgadmin

SG

unread,
Jul 11, 2017, 12:11:29 PM7/11/17
to search...@googlegroups.com
seems you miss the HTTPS config:

searchguard.ssl.http.enabled: true
searchguard.ssl.http.keystore_filepath: keystore_https_node1.jks
searchguard.ssl.http.truststore_filepath: truststore_https.jks
...

Pls read https://github.com/floragunncom/search-guard-docs/blob/master/tls_configuration.md#rest-layer-tls
> To view this discussion on the web visit https://groups.google.com/d/msgid/search-guard/d03af516-dc0f-4b1c-a085-15cb28b37b2f%40googlegroups.com.

–Mic

unread,
Jul 18, 2017, 4:53:38 AM7/18/17
to Search Guard
Sorry for the late, I was quite busy these days. I understand, but as I can read here:

# Enable or disable rest layer security - https, (default: false)
#searchguard.ssl.http.enabled: true

 if I do not specify these lines and I do not use certificates in my curl, I should be able to reach REST API, but it is not my case:

date; curl http://admin:admin@localhost:9200/_searchguard/api/user/admin
Tue Jul 18 10:27:09 CEST 2017
No certificates

I also added the line

searchguard.ssl.http.clientauth_mode: OPTIONAL

but nothing has changed... I do not understant what I have to do to make it running correctly. Any ideas?

SG

unread,
Jul 18, 2017, 9:34:17 AM7/18/17
to search...@googlegroups.com
the REST mngt api requires HTTPS, so you have to set "searchguard.ssl.http.enabled: true" and use certificates in your curl command

see https://github.com/floragunncom/search-guard-docs/blob/master/managementapi.md
> To view this discussion on the web visit https://groups.google.com/d/msgid/search-guard/c831867a-8657-4885-b7f8-b311af0ac6ac%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages