Which, as the authors show in section 7.1 and 7.2 of their paper, many PHP developers, like the authors of the Amazon Flexible Payments Service SDK and the PayPal Payments Standard SDK, will happily override with true.
You would have to read the docs to find the parameter you wish to overwrite would you not? I don't see how the curl behaviour can be faulted. If you are overwriting a default you are responsible. And you are reading the docs anyway.
This is like saying any API is reasonable as long as it's documented. If you read the example, they found numerous examples of people who clearly weren't intending to disable SSL certificate validation who nonetheless overrode that default.
No, not any API. But if the defaults err on the side of caution, which is the case here, and the non-default documentation is complete and coherent, I think that's pretty good. I don't think I would call this situation unreasonable, though I do agree that it could be improved.
There's a simple concept that one should bear in mind when designing APIs: "pit of success" (credit to Rico Mariani).
That is, failure should take effort. Dangerous options should be more laborious to express. The happy path should be the most concise and straightforward path.
I would say that by having the default be the safer option, the API is in line with that philosophy.
It takes more effort to override the default and shoot yourself in the foot.
Granted, it could be better. I guess that strange option could be a completely separate command parameter with a very obvious name. Then again, it's such a strange behaviour, maybe it just shouldn't even be an option at all.
Of course the developers are at fault here, but good API design would be to not invite developers to mess things up.
When designing the Curl API, it should have been obvious that VERIFYHOST is likely be set incorrectly, especially once it's used in languages that coerce true to 1.
I will sometimes override default values in my code even when the defaults do what I want.
Sometimes it's just because I like to be explicit and sometimes I'm concerned about the default being changed in a future version of the library or due to a server with a different config.
Not to mention that a lot of code ends up on the internet and is often blindly copied and pasted by programmers in a rush.