CURLOPT_USE_SSL.3 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. .\" generated by cd2nroff 0.1 from CURLOPT_USE_SSL.md
  2. .TH CURLOPT_USE_SSL 3 "2025-01-17" libcurl
  3. .SH NAME
  4. CURLOPT_USE_SSL \- request using SSL / TLS for the transfer
  5. .SH SYNOPSIS
  6. .nf
  7. #include <curl/curl.h>
  8. CURLcode curl_easy_setopt(CURL *handle, CURLOPT_USE_SSL, long level);
  9. .fi
  10. .SH DESCRIPTION
  11. Pass a long using one of the values from below, to make libcurl use your
  12. desired \fIlevel\fP of SSL for the transfer.
  13. These are all protocols that start out plain text and get "upgraded" to SSL
  14. using the STARTTLS command.
  15. This is for enabling SSL/TLS when you use FTP, SMTP, POP3, IMAP etc.
  16. .IP CURLUSESSL_NONE
  17. do not attempt to use SSL.
  18. .IP CURLUSESSL_TRY
  19. Try using SSL, proceed as normal otherwise. Note that server may close the
  20. connection if the negotiation does not succeed.
  21. .IP CURLUSESSL_CONTROL
  22. Require SSL for the control connection or fail with \fICURLE_USE_SSL_FAILED\fP.
  23. .IP CURLUSESSL_ALL
  24. Require SSL for all communication or fail with \fICURLE_USE_SSL_FAILED\fP.
  25. .SH DEFAULT
  26. CURLUSESSL_NONE
  27. .SH PROTOCOLS
  28. This functionality affects ftp, imap, pop3 and smtp
  29. .SH EXAMPLE
  30. .nf
  31. int main(void)
  32. {
  33. CURL *curl = curl_easy_init();
  34. if(curl) {
  35. curl_easy_setopt(curl, CURLOPT_URL, "ftp://example.com/dir/file.ext");
  36. /* require use of SSL for this, or fail */
  37. curl_easy_setopt(curl, CURLOPT_USE_SSL, (long)CURLUSESSL_ALL);
  38. /* Perform the request */
  39. curl_easy_perform(curl);
  40. }
  41. }
  42. .fi
  43. .SH HISTORY
  44. This option was known as CURLOPT_FTP_SSL up to 7.16.4, and the constants were
  45. known as CURLFTPSSL_* Handled by LDAP since 7.81.0. Fully supported by the
  46. OpenLDAP backend only.
  47. .SH AVAILABILITY
  48. Added in curl 7.17.0
  49. .SH RETURN VALUE
  50. Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
  51. .SH SEE ALSO
  52. .BR CURLOPT_PROXY_SSLVERSION (3),
  53. .BR CURLOPT_SSLVERSION (3),
  54. .BR CURLOPT_SSL_OPTIONS (3)