# Call URL with invalid SSL certificate from custom plugin

**URL:** https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350
**Category:** Kibana
**Created:** [June 16, 2020, 5:46pm UTC](https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350 "2020-06-16T17:46:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![nplatis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nplatis/32/66497_2.png) [@nplatis](https://discuss.elastic.co/u/nplatis)
#### Post date: [June 16, 2020, 5:46pm UTC](https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350/1 "2020-06-16T17:46:44Z")

</div>

We have developed a custom Kibana plugin, and it needs to call a REST API endpoint at another internal server of ours. We run Kibana on https since we need authentication, but we use a self-signed certificate since this is a private server. The service accepting the call can handle https, but so far also uses a self-signed certificate. As a result, the call fails due to "invalid" SSL certificate.

The code I am using is something like:

```auto
this.httpClient = this.props.httpClient;
...
this.httpClient.get('https://interal.server/script')...

```

Any ideas on how we could circumvent this problem? In particular, are there any options that would instruct the `httpClient` to ignore invalid certificates, like the `--no-check-certificate` option of `wget`?

I know I could add an exception to the browser (but it is not very easy, since calling the API from within Kibana is not user-visible), or buy a commercial certificate, but I would like to explore less custom or expensive options first.

Any help would be appreciated.

---

<div class="post-metadata">

### Author: ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)
#### Post date: [June 16, 2020, 5:55pm UTC](https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350/2 "2020-06-16T17:55:31Z")

</div>

Hello @nplatis

I think it would be easiest if you wrote a node script out side of kibana to perform the request and then you can move that code into the plugin. I'm not sure which `httpClient` you're using but I don't think anything thats kibana provided will do what you need. Here's some example code that will make a request using a client certificate - [https://stackoverflow.com/questions/35478215/how-to-do-https-get-with-client-certificate-in-node](https://stackoverflow.com/questions/35478215/how-to-do-https-get-with-client-certificate-in-node)

Thanks,  
Matt

---

<div class="post-metadata">

### Author: ![nplatis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nplatis/32/66497_2.png) [@nplatis](https://discuss.elastic.co/u/nplatis)
#### Post date: [June 17, 2020, 1:51pm UTC](https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350/3 "2020-06-17T13:51:24Z")

</div>

Thank you for your response.

I created the plugin with the standard generator, so I am using the `httpClient` provided. It would be good to know what exactly this is, in case I can pass some options to make it ignore the self-signed certificate.

---

<div class="post-metadata">

### Author: ![mattkime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattkime/32/43522_2.png) [@mattkime](https://discuss.elastic.co/u/mattkime)
#### Post date: [June 17, 2020, 4:00pm UTC](https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350/4 "2020-06-17T16:00:25Z")

</div>

@nplatis the httpClient provided as part of the kibana plugin system is for making calls to the kibana server. You'll find what you need with node's https module.

---

<div class="post-metadata">

### Author: ![nplatis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nplatis/32/66497_2.png) [@nplatis](https://discuss.elastic.co/u/nplatis)
#### Post date: [June 17, 2020, 4:48pm UTC](https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350/5 "2020-06-17T16:48:30Z")

</div>

Thank you again. I am exploring the 'rejectUnauthorized' option of https.

---

<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: [July 15, 2020, 4:53pm UTC](https://discuss.elastic.co/t/call-url-with-invalid-ssl-certificate-from-custom-plugin/237350/6 "2020-07-15T16:53:17Z")

</div>

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