cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLINFO_LASTSOCKET always return -1 with Https url (libcurl 7.15.4, openssl-0.9.8b)

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Fri, 7 Jul 2006 04:07:01 -0500

Have you tried command-line curl to verify what happens?? Here's what
I get, among other output:

* SSL: certificate subject name 'login.yahoo.com' does not match
target host name 'mail.yahoo.com'

Yahoo have used the same secure certificate for two different hostnames...

I think you need to set CURLOPT_SSL_VERIFYHOST.

Ralph Mitchell

On 7/7/06, Ratna Gudlavalleti <ratna_at_netenrich.com> wrote:
> I am trying to use the CURLINFO_LASTSOCKET for getting the last socket
>
> This code is working fine if I use the http://mail.yahoo.com (HTTP Server)
> Once I start using the https://mail.yahoo.com (Https Server) it always
> returns -1
>
> Am I missing something here !
>
> Thanks
> Ratna Gudlavalleti
>
> #include <fcntl.h>
> #include <io.h>
> #include <curl/curl.h>
>
> int main(void) {
> CURL *curl;
> CURLcode res;
> long last_sock=0;
>
> curl = curl_easy_init();
> if(curl) {
> curl_easy_setopt(curl, CURLOPT_URL, "https://mail.yahoo.com/");
> curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1);
>
> res = curl_easy_perform(curl);
> res = curl_easy_getinfo(curl, CURLINFO_LASTSOCKET, &last_sock);
> printf("Return code frm curl_easy_getinfo [%d][%s]\n", res,
> curl_easy_strerror(res));
> printf("curl_easy_getinfo returned CURLINFO_LASTSOCKET [%ld]\n",
> last_sock);
>
> if(CURLE_OK == res) {
> printf("curl_easy_getinfo returned CURLINFO_LASTSOCKET
> [%ld]\n", last_sock);
> }
>
> /* always cleanup */
> curl_easy_cleanup(curl);
> }
> return 0;
> }
>
Received on 2006-07-07