blob: 1f86b0e967026b6a6283b17bbe6fbf250960e55a [file] [log] [blame]
xf.li6c8fc1e2023-08-12 00:11:09 -07001c: Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
2SPDX-License-Identifier: curl
3Long: cacert
4Arg: <file>
5Help: CA certificate to verify peer against
6Protocols: TLS
7Category: tls
8See-also: capath insecure
9Example: --cacert CA-file.txt $URL
10Added: 7.5
11Multi: single
12---
13Tells curl to use the specified certificate file to verify the peer. The file
14may contain multiple CA certificates. The certificate(s) must be in PEM
15format. Normally curl is built to use a default file for this, so this option
16is typically used to alter that default file.
17
18curl recognizes the environment variable named 'CURL_CA_BUNDLE' if it is
19set, and uses the given path as a path to a CA cert bundle. This option
20overrides that variable.
21
22The windows version of curl will automatically look for a CA certs file named
23'curl-ca-bundle.crt', either in the same directory as curl.exe, or in the
24Current Working Directory, or in any folder along your PATH.
25
26If curl is built against the NSS SSL library, the NSS PEM PKCS#11 module
27(libnsspem.so) needs to be available for this option to work properly.
28
29(iOS and macOS only) If curl is built against Secure Transport, then this
30option is supported for backward compatibility with other SSL engines, but it
31should not be set. If the option is not set, then curl will use the
32certificates in the system and user Keychain to verify the peer, which is the
33preferred method of verifying the peer's certificate chain.
34
35(Schannel only) This option is supported for Schannel in Windows 7 or later
36with libcurl 7.60 or later. This option is supported for backward
37compatibility with other SSL engines; instead it is recommended to use
38Windows' store of root certificates (the default for Schannel).