cert.d 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
  2. SPDX-License-Identifier: curl
  3. Short: E
  4. Long: cert
  5. Arg: <certificate[:password]>
  6. Help: Client certificate file and password
  7. Protocols: TLS
  8. See-also: cert-type key key-type
  9. Category: tls
  10. Example: --cert certfile --key keyfile $URL
  11. Added: 5.0
  12. Multi: single
  13. ---
  14. Tells curl to use the specified client certificate file when getting a file
  15. with HTTPS, FTPS or another SSL-based protocol. The certificate must be in
  16. PKCS#12 format if using Secure Transport, or PEM format if using any other
  17. engine. If the optional password is not specified, it is queried for on
  18. the terminal. Note that this option assumes a certificate file that is the
  19. private key and the client certificate concatenated. See --cert and --key to
  20. specify them independently.
  21. In the <certificate> portion of the argument, you must escape the character ":"
  22. as "\\:" so that it is not recognized as the password delimiter. Similarly, you
  23. must escape the character "\\" as "\\\\" so that it is not recognized as an
  24. escape character.
  25. If curl is built against OpenSSL library, and the engine pkcs11 is available,
  26. then a PKCS#11 URI (RFC 7512) can be used to specify a certificate located in
  27. a PKCS#11 device. A string beginning with "pkcs11:" is interpreted as a
  28. PKCS#11 URI. If a PKCS#11 URI is provided, then the --engine option is set as
  29. "pkcs11" if none was provided and the --cert-type option is set as "ENG" if
  30. none was provided.
  31. (iOS and macOS only) If curl is built against Secure Transport, then the
  32. certificate string can either be the name of a certificate/private key in the
  33. system or user keychain, or the path to a PKCS#12-encoded certificate and
  34. private key. If you want to use a file from the current directory, please
  35. precede it with "./" prefix, in order to avoid confusion with a nickname.
  36. (Schannel only) Client certificates must be specified by a path
  37. expression to a certificate store. (Loading *PFX* is not supported; you can
  38. import it to a store first). You can use
  39. "<store location>\\<store name>\\<thumbprint>" to refer to a certificate
  40. in the system certificates store, for example,
  41. *"CurrentUser\\MY\\934a7ac6f8a5d579285a74fa61e19f23ddfe8d7a"*. Thumbprint is
  42. usually a SHA-1 hex string which you can see in certificate details. Following
  43. store locations are supported: *CurrentUser*, *LocalMachine*, *CurrentService*,
  44. *Services*, *CurrentUserGroupPolicy*, *LocalMachineGroupPolicy* and
  45. *LocalMachineEnterprise*.