0

When I run curl -V my output is this

curl 7.82.0-DEV (x86_64-pc-win32) libcurl/7.82.0-DEV OpenSSL/1.1.1m WinIDN
Release-Date: [unreleased]
Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI UnixSockets alt-svc

Https is clearly there. When I use it through c++, by using curl_version_info_data

curl_version_info_data* ver = curl_version_info(CURLVERSION_NOW);
    for (int i = 0; i < 14; ++i) {
        cout << ver->protocols[i] << endl;
    }

The supported protocols listed are

dict
file
ftp
gopher
http
imap
ldap
mqtt
pop3
rtsp
smb
smtp
telnet
tftp

If I try using https, I get the error Unsupported protocol. Anyone get any ideas?

ZWang
  • 832
  • 5
  • 14
  • Take another libcurl. – 273K Mar 03 '22 at 06:56
  • How did you compile and link? OpenSSL is surely provided by a separate library. Hence, libcurl may drop ftps, https, etc. if OpenSSL is not activated. FYI: [Building libcurl with SSL support on Windows](https://stackoverflow.com/q/197444/7478597) or [google "libcurl openssl"](https://www.google.com/search?q=libcurl+openssl) by yourself. – Scheff's Cat Mar 03 '22 at 06:57
  • @Scheff'sCat Downloaded OpenSSL as binary and installed, linked using WITH_DEVEL. However I'm confused, the build with WINSSL also says https is available but it's not? – ZWang Mar 03 '22 at 06:58
  • Please show a [mre] of the code that is failing. Why are you only printing 14 protocols? Is the curl command line using the same libcurl as your application? – Alan Birtles Mar 03 '22 at 07:36

1 Answers1

0

I figured it out, when running I tried fixing by grabbing libcurl.lib and libcurl_imp.lib from a precompiled version of Curl (I had two versions installed). The precompiled version did not have support for https. I read the FAQ here https://curl.se/docs/faq.html and properly linked the static library. Afterwards, it worked fine.

ZWang
  • 832
  • 5
  • 14