SSLHandshakeException when enabling security

Hi we have a working cluster but when we enable xpack security the transport communication fails.

bootstrap.memory_lock: true
- elasticsearch-prod
http.port: 9200 false
node.ingest: true
node.master: true
node.max_local_storage_nodes: 1 ELK C:\tools\elasticsearch\data
path.logs: C:\tools\elasticsearch\logs
transport.tcp.port: 9300
xpack.license.self_generated.type: basic true true certs\myssl.pfx certs\myssl.pfx true certificate certs/myssl.pfx certs/myssl.pfx

Communication to https...:9200 works fine - but https....:9300 fails with Received fatal alert: bad_certificate

What and why is communication different ? We have tried a lot of different solutions. Another funny thing is this "cluster_uuid" : "na" :-:thinking:

Version: Elastic 7.1.1

Best regards

Aage Nielsen

You haven't given us much to go on but ...

Where did this myssl.pfx file come from?
Based on the fact that it's named "pfx" I suspect it was created by tooling in a microsoft/windows environment.
If so, then it is quite likely that it has the right data in it to act as a keystore, but not as a truststore.

The technical explanation is that a PKCS#12 file (your .pfx) is technically a key storage format. Java uses its "keystore" format to also store CAs, which it calls a "truststore", and it uses special PKCS#12 entries to do that.
It is rare for non-Java tooling to create those trust entries.

If that pfx was issued to you by a CA, then you probably want to get a copy of their CA cert in PEM format, and then replace the with [ "path/to/ca.pem" ]

And likewise for http.ssl

The PFX filen was delivered directly from the CA (DigiCert). The PKCS12/PFX file contains the entire chain including the CA cert. It just did not make (much) sense that communication with 9200 was ok and 9300 was not. We did the configuration exactly as stated in your documentation at

But anyhow - we exported the CA from the PFX file and applied certs/ca.cer

And still the same error :frowning:

That's not the issue. Using a PKCS#12 as a truststore requires additional entries. It will not automatically trust every issuer of every certificate that is stored as a key, it needs explicit entires for "trust this CA (chain)".

Oh. You're trying to connect to port 9300 using https. That won't work.

9200 is the http port.
9300 is the transport port. It is used for internal communications in a bespoke binary format , it cannot be used over https.

Hmmm the cluster nodes are still getting the same error when trying to communicate - bad certificate. As stated - we have followed the documentation. Now we have created a new standard jks keystore and change the elastic configuration - and a new error occurs -

Caused by: io.netty.handler.ssl.NotSslRecordException: not an SSL/TLS record

Any clue what that is ?


Wait wait - now the cluster is up and running :slight_smile:

So I guess it had something to do with - elastic not being able to figure out the pfx format for the 9300 communication but could with plain https at 9200.

Thanks for your help

Best regards

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.