Skip to content

/flags/curl/curl-k-insecure

curl -k (--insecure): skip TLS certificate verification

verified onenvironmentlocal · windows 10.0.26200 arm64 · GNU bash 5.3.15 (Git Bash) · curl 8.21.0 (x86_64-w64-mingw32) libcurl/8.21.0 Schannel zlib/1.3.2updated 2026-10-20
tool
curl
command
curl
flag
-k, --insecure
default
off (certificates are verified)

curl -k (long form --insecure) disables verification of the server's TLS certificate, so curl connects even when the certificate is self-signed, expired or issued for another host name. The traffic is still encrypted, but you no longer know who is on the other end. Use it for local testing only.

Without and with -k

Against a host that serves a self-signed certificate:

bash
curl -sS -o /dev/null https://self-signed.badssl.com/

Output · exit 60

curl: (60) schannel: SEC_E_UNTRUSTED_ROOT (0x80090325) - The certificate chain was issued by an authority that is not trusted.
More details here: https://curl.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 webpage mentioned above.

The text after curl: (60) depends on the TLS library curl was built with. OpenSSL builds, common on Linux, describe the certificate problem in their own words; the Windows build (Schannel) used here reports the Windows error code.

bash
curl -sSk -o /dev/null -w '%{http_code}\n' https://self-signed.badssl.com/

Output

200

Safer alternatives

SituationUse instead of -k
Internal service signed by your own CA--cacert /path/to/ca.pem
Corporate proxy that re-signs TLSadd the proxy CA to the system store, or --cacert
Pin one known server--pinnedpubkey sha256//<base64-hash>
Certificate for another name (testing)--resolve host:443:IP and the right host name

Sources