brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: curl --cacert trusts your own CA, so you do not need -k

Curl
~/tips/tip-curl-cacert-own-ca

curl --cacert /etc/ssl/homelab-ca.pem https://nas.lan:8443/

Verifies a server against your own certificate authority instead of skipping verification.

A self-signed or internal certificate gives curl error 60, and `-k` is the tempting but dangerous way out.

curl --cacert /etc/ssl/homelab-ca.pem https://nas.lan:8443/

-k switches certificate checks off, so it also accepts a certificate from someone sitting in the middle. --cacert replaces the default bundle with the one CA file you name, which keeps the check intact and still accepts your internal certificate. Setting CURL_CA_BUNDLE in the environment does the same for every call. To trust the CA system-wide, copy it to /usr/local/share/ca-certificates/ and run update-ca-certificates.

Further reading: curl manual

Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get

More Curl tips curl --trace-ascii – https://example.com/ Retry-After: 120 curl -fsS --fail-early \ url = "https://example.com/data/latest.json" curl -4 -s -o /dev/null -w '%{remote_ip} %{http_code}\n' https://example.com/ All Curl tips (71) All topics

Link