or private-key protected resources,
e.g. **sftp://user@some-internal-server/etc/passwd**
-The CURLOPT_REDIR_PROTOCOLS(3) and CURLOPT_NETRC(3) options can be
+The CURLOPT_REDIR_PROTOCOLS_STR(3) and CURLOPT_NETRC(3) options can be
used to mitigate against this kind of attack.
A redirect can also specify a location available only on the machine running
Applications can mitigate against this by disabling
CURLOPT_FOLLOWLOCATION(3) and handling redirects itself, sanitizing URLs
as necessary. Alternately, an app could leave CURLOPT_FOLLOWLOCATION(3)
-enabled but set CURLOPT_REDIR_PROTOCOLS(3) and install a
+enabled but set CURLOPT_REDIR_PROTOCOLS_STR(3) and install a
CURLOPT_OPENSOCKETFUNCTION(3) or CURLOPT_PREREQFUNCTION(3) callback
function in which addresses are sanitized before use.
could point to a private resource. For example, a web app providing a
translation service might happily translate **file://localhost/etc/passwd**
and display the result. Applications can mitigate against this with the
-CURLOPT_PROTOCOLS(3) option as well as by similar mitigation techniques
+CURLOPT_PROTOCOLS_STR(3) option as well as by similar mitigation techniques
for redirections.
A malicious FTP server could in response to the PASV command return an IP
curl command lines can use *--proto* to limit what URL schemes it accepts
-## Use CURLOPT_PROTOCOLS
+## Use CURLOPT_PROTOCOLS_STR
-libcurl programs can use CURLOPT_PROTOCOLS(3) to limit what URL schemes it accepts
+libcurl programs can use CURLOPT_PROTOCOLS_STR(3) to limit what URL schemes it accepts
## consider not allowing the user to set the full URL
The *backend* struct member is one of the defines in the CURLSSLBACKEND_*
series: CURLSSLBACKEND_NONE (when built without TLS support),
CURLSSLBACKEND_WOLFSSL, CURLSSLBACKEND_SECURETRANSPORT, CURLSSLBACKEND_GNUTLS,
-CURLSSLBACKEND_MBEDTLS, CURLSSLBACKEND_NSS, CURLSSLBACKEND_OPENSSL,
-CURLSSLBACKEND_SCHANNEL or CURLSSLBACKEND_MESALINK. (Note that the OpenSSL
+CURLSSLBACKEND_MBEDTLS, CURLSSLBACKEND_NSS, CURLSSLBACKEND_OPENSSL or
+CURLSSLBACKEND_SCHANNEL. (Note that the OpenSSL
forks are all reported as just OpenSSL here.)
The *internals* struct member points to a TLS library specific pointer for
Section: 3
Source: libcurl
See-also:
- - CURLOPT_PROTOCOLS (3)
+ - CURLOPT_PROTOCOLS_STR (3)
- CURLOPT_URL (3)
- curl_url_set (3)
- libcurl-security (3)
- CURLINFO_REDIRECT_COUNT (3)
- CURLINFO_REDIRECT_URL (3)
- CURLOPT_POSTREDIR (3)
- - CURLOPT_PROTOCOLS (3)
- - CURLOPT_REDIR_PROTOCOLS (3)
+ - CURLOPT_PROTOCOLS_STR (3)
+ - CURLOPT_REDIR_PROTOCOLS_STR (3)
Protocol:
- HTTP
---
number of redirects libcurl follows.
libcurl restricts what protocols it automatically follow redirects to. The
-accepted target protocols are set with CURLOPT_REDIR_PROTOCOLS(3). By
+accepted target protocols are set with CURLOPT_REDIR_PROTOCOLS_STR(3). By
default libcurl allows HTTP, HTTPS, FTP and FTPS on redirects.
When following a redirect, the specific 30x response code also dictates which
See-also:
- CURLOPT_HTTPPOST (3)
- CURLOPT_POSTFIELDS (3)
- - CURLOPT_PUT (3)
+ - CURLOPT_UPLOAD (3)
---
# NAME
Source: libcurl
See-also:
- CURLOPT_PROXY (3)
- - CURLOPT_SOCKS5_GSSAPI_SERVICE (3)
+ - CURLOPT_PROXY_SERVICE_NAME (3)
Protocol:
- All
---
/* Set the URL of the request */
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
/* Now set it as a put */
- curl_easy_setopt(curl, CURLOPT_PUT, 1L);
+ curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
/* Assuming we have a function that returns the data to be pushed
Let that function be read_cb */
- CURLOPT_FORBID_REUSE (3)
- CURLOPT_FRESH_CONNECT (3)
- CURLOPT_PATH_AS_IS (3)
- - CURLOPT_PROTOCOLS (3)
+ - CURLOPT_PROTOCOLS_STR (3)
- curl_easy_perform (3)
- curl_url_get (3)
- curl_url_set (3)
services.
Accepting external URLs may also use other protocols than http:// or other
-common ones. Restrict what accept with CURLOPT_PROTOCOLS(3).
+common ones. Restrict what accept with CURLOPT_PROTOCOLS_STR(3).
User provided URLs can also be made to point to sites that redirect further on
(possibly to other protocols too). Consider your
-CURLOPT_FOLLOWLOCATION(3) and CURLOPT_REDIR_PROTOCOLS(3) settings.
+CURLOPT_FOLLOWLOCATION(3) and CURLOPT_REDIR_PROTOCOLS_STR(3) settings.
# EXAMPLE