# Fscrawler refuses connection over https

**URL:** https://discuss.elastic.co/t/fscrawler-refuses-connection-over-https/291689
**Category:** Elasticsearch
**Created:** [December 13, 2021, 4:18pm UTC](https://discuss.elastic.co/t/fscrawler-refuses-connection-over-https/291689 "2021-12-13T16:18:50Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ehsan\_kabiri\_33](https://avatars.discourse-cdn.com/v4/letter/e/b77776/32.png) [@ehsan\_kabiri\_33](https://discuss.elastic.co/u/ehsan_kabiri_33)
#### Post date: [December 13, 2021, 4:18pm UTC](https://discuss.elastic.co/t/fscrawler-refuses-connection-over-https/291689/1 "2021-12-13T16:18:50Z")

</div>

I've studied [this page](https://fscrawler.readthedocs.io/en/fscrawler-2.7/admin/fs/elasticsearch.html#ssl-configuration) and really do not not how to make and use `.cer` certificate, so can't launch fscrawler over secured connection.

I created a certificate like this:

```auto
sudo ./elasticsearch-certutil ca -out /etc/elasticsearch/elastic-stack-ca.p12 -pass "myPassword"

sudo ./elasticsearch-certutil cert --ca /etc/elasticsearch/elastic-stack-ca.p12 -out /etc/elasticsearch/elastic-certificates.p12 -pass "myPassword2"

```

and this is my `elasticsearch.yml`:

```auto
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.transport.ssl.keystore.password: "myPassword2"
xpack.security.transport.ssl.truststore.password: "myPassword2"

xpack.security.http.ssl.enabled: true
xpack.security.http.ssl.keystore.path: elastic-certificates.p12
xpack.security.http.ssl.truststore.path: elastic-certificates.p12
xpack.security.http.ssl.keystore.password: "myPassword2"
xpack.security.http.ssl.truststore.password: "myPassword2"

```

I have not used `.cer` to secure my elastic and kibana.  
So I need to know some more detail.

This is `resumes/_settings.yaml`

```auto
elasticsearch:
  username: "elastic"
  password: "pass"
  nodes:
  - url: "https://192.168.225.135:2022"
  - url: "https://192.168.225.136:2022"
  byte_size: "10mb"
  ssl_verification: true

```

This is part of log file on fscrawler start

```auto
failed to create elasticsearch client on Elasticsearch{nodes=[https://192.168.225.135:2022, https://192.168.225.136:2022], index='resumes', indexFolder='resumes_folder', bulkSize=100, flushInterval=5s, byteSize=10mb, username='elastic', pipeline='null', pathPrefix='null', sslVerification='true'}, disabling crawler...
We can not start Elasticsearch Client. Exiting.org.elasticsearch.ElasticsearchException: java.util.concurrent.ExecutionException: java.net.ConnectException: Connection refused

```

I created `.der` like this

```auto
sudo openssl pkcs12 -in /etc/elasticsearch/elastic-certificates.p12 -out /etc/elasticsearch/ca.der
keytool -import -alias myalias -keystore "/usr/lib/jvm/java-11-openjdk-amd64/lib/security/cacerts" -file /etc/elasticsearch/ca.der

```

but results in

```auto
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect

```

---

<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: [January 10, 2022, 4:19pm UTC](https://discuss.elastic.co/t/fscrawler-refuses-connection-over-https/291689/2 "2022-01-10T16:19:23Z")

</div>

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