curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Re: CURLOPT_PROTOCOLS_STR man page

From: dogma via curl-library <curl-library_at_lists.haxx.se>
Date: Sun, 14 Jun 2026 23:31:01 +0000

On Sun, Jun 14, 2026 at 10:14:38PM +0200, Daniel Stenberg wrote:
> On Sun, 14 Jun 2026, dogma via curl-library wrote:
>
> > The man page gives me the impression that if CURLE_UNSUPPORTED_PROTOCOL
> > is returned, CURLOPT_PROTOCOLS_STR probably didn’t change anything.
> >
> > But I found that passing it, e.g., "http,https,unrecognized" made it
> > complain about unrecognized but it did change the allowed protocols to
> > http and https, as I was hoping.
>
> You did not say which libcurl version you're using, but looking at the
> current code I cannot see it working like you describe. A single bad
> protocol in the input list will cause it to return error and leave the
> setting in its previous state.

So I redid my testing and got what you indicate instead. I don’t know what went wrong last time.
Not that it matters now, but this is with 8.20.0, the most recent release.

My concern was a scenario like:
I specify "http,https,file", thinking to be more secure when I’m not doing anything useful with the other schemes anyway (https://curl.se/libcurl/security.html showing how nasty a protocol such as scp can be).
A user configures libcurl to disable "http".
The call fails and I haven’t accomplished anything.

I guess I have to consult the protocol list out of curl_version_info() as I construct my string?

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2026-06-15