elasticsearch-HQ icon indicating copy to clipboard operation
elasticsearch-HQ copied to clipboard

cant connect to an elastic cluster with ssl cert thats self generated

Open obsd-guru opened this issue 3 years ago • 4 comments

General information

running elastichq as a container in an k8s enviroment, running " elastichq/elasticsearch-hq" from dockerhub.

Issue Description

access Elastic Cluster with no SSL : works access Elastic Cluster with valid SSL : works access Elastic Cluster with self-signed SSL : doenst work HQ_VERIFY_CERTS is set to False

Source Code / Logs

in the logs are lines like

Message: 'Unable to create connection to: https://10.10.10.10:9200' Arguments: (SSLError(MaxRetryError("HTTPSConnectionPool(host='10.10.10.10', port=9200): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)'),))",),),)

Be Patient

i will, but still looking forward for any tips ;)

obsd-guru avatar Feb 08 '21 14:02 obsd-guru

I came here to report similar. Running with docker run -it --rm -p 5000:5000 -e HQ_VERIFY_CERTS=False elastichq/elasticsearch-hq and seeing the above error.

WintersMichael avatar Feb 22 '21 15:02 WintersMichael

I am no expert at this, but this solved my similar issue (adding the enable SSL variable): docker run --rm -p 5000:5000 -e "HQ_ENABLE_SSL=True" -e "HQ_VERIFY_CERTS=False" elastichq/elasticsearch-hq

Connected successfully to elasticsearch (from ElasticHQ webpage) using https://[ip]:9200

Ohlnielsen avatar Mar 08 '21 14:03 Ohlnielsen

I have tried passing this variable, and still have issues connectiong. Since the only error is "bad certificate" I would guess it is still trying to verify the self signed cert.

sangdrax8 avatar Jul 02 '21 17:07 sangdrax8

Connect to ES cluster with self-signed certificates successfully.

Write environment file on any path:

HQ_VERIFY_CERTS=False HQ_DEFAULT_URL=https://[HOST]:9200/ HQ_CA_CERTS=/path/to/ca.pem <= Issuer CA HQ_ENABLE_SSL=True

And run container using env file: docker run --env-file /path/to/env -p 5000:5000 elastichq/elasticsearch-hq

hummermania avatar Sep 17 '21 17:09 hummermania