# Rest Api with curl response over https

**URL:** https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012
**Category:** Graylog Central (peer support)
**Tags:** curl
**Created:** [September 5, 2023, 8:37pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012 "2023-09-05T20:37:23Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![yalfa](https://avatars.discourse-cdn.com/v4/letter/y/4af34b/32.png) [@yalfa](https://community.graylog.org/u/yalfa)
#### Post date: [September 5, 2023, 8:37pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/1 "2023-09-05T20:37:23Z")

</div>

Hi, when I am trying curl over https the error is returned:  
curl: (60) SSL certificate problem: unable to get local issuer certificate  
The https is works fine.  
Follows the command  
curl -u user:senha -H ‘Accept: application/json’ -X GET ‘[https://mygraylogserver.example.com:9000/api/cluster?pretty=true](https://mygraylogserver.example.com:9000/api/cluster?pretty=true)’

Graylog 4.3.15+17ed3ac on graylog (Debian 11.0.18 on Linux 4.19.0-24-amd64)

I enable reverse proxy https and the problem continues

How I use curl to get response in https?  
In the [Graylog REST API](https://go2docs.graylog.org/4-x/setting_up_graylog/rest_api.html) curl is used with http protocol

Thank you!

---

<div class="post-metadata">

### Author: ![Joel\_Duffield](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Joel\_Duffield](https://community.graylog.org/u/Joel_Duffield)
#### Post date: [September 5, 2023, 10:30pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/2 "2023-09-05T22:30:59Z")

</div>

What are you trying to do, because your url path is for open/elasticsearch api but you are using port 9000 which is the graylog port, port 9200 is normally the elastic/opensearch port.

---

<div class="post-metadata">

### Author: ![yalfa](https://avatars.discourse-cdn.com/v4/letter/y/4af34b/32.png) [@yalfa](https://community.graylog.org/u/yalfa)
#### Post date: [September 5, 2023, 11:59pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/3 "2023-09-05T23:59:26Z")

</div>

Hello, I want to receive the response in JSON using the command through curl. If I use the --insecure parameter with curl it works normally and I get the response in JSON.  
curl --insecure -u user:password -H ‘Accept: application/json’ -X GET ‘[https://mygraylogserver.example.com](https://mygraylogserver.example.com) :9000/api/cluster?pretty=true’.  
I’m beginner to graylog and I didn’t find any documentation about doing the api query with https enabled without using --insecure parameter  
thanks

---

<div class="post-metadata">

### Author: ![yalfa](https://avatars.discourse-cdn.com/v4/letter/y/4af34b/32.png) [@yalfa](https://community.graylog.org/u/yalfa)
#### Post date: [September 11, 2023, 4:50pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/4 "2023-09-11T16:50:24Z")

</div>

Hi @Joel_Duffield, can you help me, please?

 ![Capturar](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/2/248a3e8b6c8b776ddd7cb95fa90c1bebb4cd53c4.jpeg)

---

<div class="post-metadata">

### Author: ![Joel\_Duffield](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Joel\_Duffield](https://community.graylog.org/u/Joel_Duffield)
#### Post date: [September 11, 2023, 7:51pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/5 "2023-09-11T19:51:11Z")

</div>

Are you using a self signed cert for your graylog? Is this curl command running from a remote machine? On the face of it it just looks like the machine that is running curl doesn’t trust the certificate.

---

<div class="post-metadata">

### Author: ![yalfa](https://avatars.discourse-cdn.com/v4/letter/y/4af34b/32.png) [@yalfa](https://community.graylog.org/u/yalfa)
#### Post date: [September 11, 2023, 8:17pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/6 "2023-09-11T20:17:48Z")

</div>

> [@Joel\_Duffield](#):
>
> On the face of it it just looks like the machine that is running curl doesn’t trust the certificate.

Yes, the self signed cert is provide by godaddy (print1 attachament).  
Yes too, the curl command is from remote machine.

The https is working normally in the browser…  
Curl shows me the follows error _“curl: (60) SSL certificate problem: unable to get local issuer certificate”_

If self certifcate is works in the browser, why in the curl doesnt works?

In the reference [Graylog REST API](https://go2docs.graylog.org/4-x/setting_up_graylog/rest_api.html), curl command example is http…

Is there one reference thats show curl running with https?

Thank you

 ![print2](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/8/8b98000924acf8ea12be20888c33696c08f200af.jpeg)

 ![print1](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/2X/3/31a0c9183621ae7f82c3a470c147b11e00aa2422.jpeg)

---

<div class="post-metadata">

### Author: ![Joel\_Duffield](https://avatars.discourse-cdn.com/v4/letter/j/71c47a/32.png) [@Joel\_Duffield](https://community.graylog.org/u/Joel_Duffield)
#### Post date: [September 11, 2023, 8:57pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/7 "2023-09-11T20:57:20Z")

</div>

Why it’s not trusting the cert in curl I don’t, but that does sound like the issue. You may want to try some of the troubleshooting steps from this vmware doc on the topic to figure what is missing for it not to be trusted. [VMware Knowledge Base](https://kb.vmware.com/s/article/78471)

---

<div class="post-metadata">

### Author: ![yalfa](https://avatars.discourse-cdn.com/v4/letter/y/4af34b/32.png) [@yalfa](https://community.graylog.org/u/yalfa)
#### Post date: [September 12, 2023, 6:05pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/8 "2023-09-12T18:05:04Z")

</div>

Hi @Joel_Duffield the problem was resolved with the vmware reference…  
_If the insecure certificate is a self-signed, known-trusted certificate, load the certificate to your local trusted certificate location for your OS._

Thank you

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [September 26, 2023, 6:05pm UTC](https://community.graylog.org/t/rest-api-with-curl-response-over-https/30012/9 "2023-09-26T18:05:52Z")

</div>

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