I am trying to run curl command from Gitlab Pipeline to perform a post call on a Host.
Here is the sample curl
curl -X -k POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <token>" \
-d '{ "key": "foo", "value": "bar" }' \
"https://<host url>"
Please Note I am already trying to run in insecure mode using -k.
Still I am getting below error.
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html
curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.
If I run this in Postman, disabling SSL verification from settings, it works as expected.
There is no certificate for this host and its in the internal network.
How do I make this curl work ? Why is -k not working here ?
Use --insecure flag instead of -k and run the cURL command. For eg: