Skip to content

Error: tls: failed to verify certificate: x509: certificate #844

@kaykhan

Description

@kaykhan

I am attempting to use this provider but i am having trouble with authenticating to my elasticsearch.

  1. I am firstly portforwarding elasticisearch
kubectl port-forward service/elasticsearch-prod-eck-elasticsearch-es-http 9200 -n elastic-system
  1. I then test connection locally using username and password - which works.
https://localhost:9200/
  1. But when i attempt to use terraform i get a tls error because its localhost.
provider "elasticstack" {
  elasticsearch {
    username  = "elastic"
    password  = "<redacted>"
    endpoints = ["https://localhost:9200"]
  }
}
terraform apply

Error: tls: failed to verify certificate: x509: certificate is valid for elasticsearch-prod-eck-elasticsearch-es-http.elastic-system.es.local, elasticsearch-prod-eck-elasticsearch-es-http, elasticsearch-prod-eck-elasticsearch-es-http.elastic-system.svc, elasticsearch-prod-eck-elasticsearch-es-http.elastic-system, elasticsearch-prod-eck-elasticsearch-es-internal-http.elastic-system.svc, elasticsearch-prod-eck-elasticsearch-es-internal-http.elastic-system, *.elasticsearch-prod-eck-elasticsearch-es-default.elastic-system.svc, not localhost

How do i get around this issue so that i can make changes to the elasticsearch cluster in local development (i'm not yet ready to expose it via a lb).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions