Fix curl 421 errors when disabling verify peer

```
== Info: WARNING: disabling hostname validation also disables SNI.
```
which leads to a "431 Misdirected Request" reply for servers
with shared hosting.
This commit is contained in:
Robin Gareus 2025-12-09 23:05:29 +01:00
parent 8a9f72ad88
commit b11ef7fee4
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 4 additions and 6 deletions

View file

@ -103,9 +103,6 @@ _pingback (void *arg)
#ifdef MIXBUS
curl_easy_setopt (h.curl (), CURLOPT_FOLLOWLOCATION, 1);
/* do not check cert */
curl_easy_setopt (h.curl (), CURLOPT_SSL_VERIFYPEER, 0);
curl_easy_setopt (h.curl (), CURLOPT_SSL_VERIFYHOST, 0);
#endif
ping_call* cm = static_cast<ping_call*> (arg);

View file

@ -348,8 +348,5 @@ SoundcloudUploader::setcUrlOptions()
// Allow connections to time out (without using signals)
curl_easy_setopt(curl_handle, CURLOPT_NOSIGNAL, 1);
curl_easy_setopt(curl_handle, CURLOPT_CONNECTTIMEOUT, 30);
curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYHOST, 0);
curl_easy_setopt(curl_handle, CURLOPT_SSL_VERIFYPEER, 0);
}

View file

@ -96,6 +96,10 @@ CCurl::curl () const
void
CCurl::ca_setopt (CURL* c)
{
#if defined PLATFORM_WINDOWS || defined __APPLE__
/* winSSL and DarwinSSL does not need this, use defaults w/VERIFYHOST */
return;
#endif
if (ca_info) {
curl_easy_setopt (c, CURLOPT_CAINFO, ca_info);
}