TL;DR
I am receiving the following error in my Elasticsearch log when Kibana attempts to connect with TLS enabled:
javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown
Full Story
I’m receiving this error in my Elasticsearch log when Kibana attempts to connect with TLS enabled. As far as I can tell, everything is configured correctly. My config files and error log follow. All certificates are issued and signed by our company, and elasticsearch.ssl.certificateAuthorities
contains the full certificate chain.
Edit: This is being deployed via Kubernetes, not on servers with static IP addresses.
elasticsearch.yml
action:
auto_create_index: ".*,sg7-*,searchguard,searchguard*"
# Allow both primary and non-primary shards to be moved between nodes for
# balancing purposes.
cluster:
routing.allocation.enable: all
xpack:
# Disable xpack.security when using SearchGuard.
security.enabled: false
# Cluster monitoring configuration.
monitoring:
enabled: true
collection:
enabled: true
# SearchGuard configuration.
searchguard:
# Next line is for use in sandbox only.
# allow_unsafe_democertificates: true
# nodes_dn:
# - ".*"
allow_default_init_sgindex: true
audit:
type: internal_elasticsearch
authcz:
admin_dn:
- EMAILADDRESS=pki@example.com,CN=elk.example.com,OU=Example USA,O=Example USA,L=Smallville,ST=Kansas,C=US
check_snapshot_restore_write_privileges: true
enable_snapshot_restore_privilege: true
restapi:
roles_enabled:
- SGS_ALL_ACCESS
# Searchguard config
ssl:
http:
# Mount certs to /usr/share/elasticsearch/config/certs
enabled: true
pemcert_filepath: certs/cert.pem
pemkey_filepath: certs/key-p8.pem
pemtrustedcas_filepath: certs/ca_bundle.pem
clientauth_mode: OPTIONAL
enabled_protocols:
- TLSv1.3
- TLSv1.2
- TLSv1.1
transport:
# Mount certs to /usr/share/elasticsearch/config
pemcert_filepath: certs/cert.pem
pemkey_filepath: certs/key-p8.pem
pemtrustedcas_filepath: certs/ca_bundle.pem
enforce_hostname_verification: false
kibana.yml
# Xpack configuration.
xpack:
# Configure xpack security.
security.enabled: false
elasticsearch:
username: "${SG_KIBANASERVER_USER}"
password: "${SG_KIBANASERVER_PASSWD}"
ssl:
alwaysPresentCertificate: false
certificate: /usr/share/kibana/config/certs/cert.pem
certificateAuthorities:
# - /usr/share/kibana/config/certs/ca_bundle.pem
- /usr/share/kibana/config/certs/ca_root.pem
- /usr/share/kibana/config/certs/ca_int.pem
key: /usr/share/kibana/config/certs/key.pem
verificationMode: none
Error Log
{"type": "server", "timestamp": "2020-04-21T21:15:59,059Z", "level": "WARN", "component": "o.e.h.AbstractHttpServerTransport", "cluster.name": "es", "node.name": "es-master-0", "message": "caught exception while handling client http traffic, closing connection Netty4HttpChannel{localAddress=/10.229.94.166:9200, remoteAddress=/10.229.91.23:48970}", "cluster.uuid": "hvkuxjblQ3WsHjz8ON35-g", "node.id": "_tl82_dSQBiOxnZBzJaGXQ" ,
"stacktrace": ["io.netty.handler.codec.DecoderException: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown",
"at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:473) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:281) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1422) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:931) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:700) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.nio.NioEventLoop.processSelectedKeysPlain(NioEventLoop.java:600) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:554) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:514) [netty-transport-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) [netty-common-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-common-4.1.43.Final.jar:4.1.43.Final]",
"at java.lang.Thread.run(Thread.java:830) [?:?]",
"Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: certificate_unknown",
"at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[?:?]",
"at sun.security.ssl.Alert.createSSLException(Alert.java:117) ~[?:?]",
"at sun.security.ssl.TransportContext.fatal(TransportContext.java:311) ~[?:?]",
"at sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:291) ~[?:?]",
"at sun.security.ssl.TransportContext.dispatch(TransportContext.java:184) ~[?:?]",
"at sun.security.ssl.SSLTransport.decode(SSLTransport.java:164) ~[?:?]",
"at sun.security.ssl.SSLEngineImpl.decode(SSLEngineImpl.java:729) ~[?:?]",
"at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:684) ~[?:?]",
"at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:499) ~[?:?]",
"at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:475) ~[?:?]",
"at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:634) ~[?:?]",
"at io.netty.handler.ssl.SslHandler$SslEngineType$3.unwrap(SslHandler.java:280) ~[netty-handler-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1332) ~[netty-handler-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1227) ~[netty-handler-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1274) ~[netty-handler-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:503) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]",
"at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:442) ~[netty-codec-4.1.43.Final.jar:4.1.43.Final]",
"... 16 more"] }