# Reindex with https

**URL:** <https://discuss.elastic.co/t/reindex-with-https/245031>\
**Category:** Elasticsearch\
**Created:** [August 14, 2020, 2:29pm UTC](https://discuss.elastic.co/t/reindex-with-https/245031 "2020-08-14T14:29:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dimm](https://avatars.discourse-cdn.com/v4/letter/d/e9bcb4/32.png) [@dimm](https://discuss.elastic.co/u/dimm)\
**Post date:** [August 14, 2020, 2:29pm UTC](https://discuss.elastic.co/t/reindex-with-https/245031/1 "2020-08-14T14:29:40Z")

</div>

Hi,

I'm tryning to migrate data from my OLD\_ELASTIC server (version 6.2) to the NEW\_ELASTIC (version 7.8.1) using REINDEX approcach but with https connection.

My NEW\_ELASTIC elasticsearch.yml contains:

```auto
...
reindex.remote.whitelist: OLD_ELASTIC:9200
reindex.ssl.certificate: OLD_ELASTIC_cacert.pem
reindex.ssl.key: OLD_ELASTIC_key.key
reindex.ssl.verification_mode: certificate
...

```

My OLD\_ELASTIC elasticsearch.yml contains:

```auto
...
xpack.security:
...
    http:
        ssl.enabled: true
        ssl.verification_mode: certificate
...

```

My OLD\_ELASTIC\_cacert.pem is valid because I can query my OLD\_ELASTIC cluster with curl:

```auto
NEW_ELASTIC> curl -XGET --cacert OLD_ELASTIC_cacert.pem -u OLD_ELASTIC_USER "https://OLD_ELASTIC:9200/_cat/indices?v"
Enter host password for user 'OLD_ELASTIC_USER':
health status index uuid pri rep docs.count docs.deleted store.size pri.store.size
...
... datdatdatdatadata ...
...

```

But when I trying to execute data reindex from OLD\_ELASTIC to NEW\_ELASTIC using https(not http!)

```auto
curl -XPOST -H "Content-Type: application/json;charset=UTF-8" --cacert cacert.pem -u admin 'https://NEW_ELASTIC:9200/_reindex?wait_for_completion=false' -d '
{
  "source": {
    "remote": {
      "host": "https://OLD_ELASTIC:9200",
      "username": "OLD_ELASTIC_USER",
      "password": "PASS"
    },
    "index": "OLD_INDEX",
    "query": {
      "match_all": {}
    }
  },
  "dest": {
    "index": "NEW_CREATED_INDEX"
  }
}'

```

Reindex task ends with error:

```auto
...
 "error" : {
    "type" : "s_s_l_handshake_exception",
    "reason" : "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",
    "caused_by" : {
      "type" : "validator_exception",
      "reason" : "PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target",
      "caused_by" : {
        "type" : "sun_cert_path_builder_exception",
        "reason" : "unable to find valid certification path to requested target"
      }
    }
  }
...

```

Maybe there is a way to add my certificate to OLD\_ELASTIC server so it will accept https connection from NEW\_ELASTIC ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 11, 2020, 2:29pm UTC](https://discuss.elastic.co/t/reindex-with-https/245031/2 "2020-09-11T14:29:41Z")

</div>

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