cURL / Mailing Lists / curl-library / Single Mail

curl-library

HTTPS via schannel not working with multi-interface

From: Christian Hägele <haegele_at_teamviewer.com>
Date: Mon, 09 Jul 2012 12:35:13 +0200

Hello,

I tested HTTPS on windows using schannel instead of OpenSSL. I used the
multi-
interface for my tests and it didn't work properly.

I think I spotted the problem already. In http.c the function https_getsock
is only implemented properly when USE_SSLEAY or USE_GNUTLS is defined, but
it
is also necessary for USE_SCHANNEL. I attached a trivial patch to fix this.

Some additional information:
The problem occurs when Curl_read_plain or Curl_write_plain returns
CURLE_AGAIN. In that case CURL_OK is returned to the multi-interface an the
used socket is set to state CURL_POLL_REMOVE and the easy-state is set to
CURLM_STATE_PROTOCONNECT. This is fine, because later the socket should be
set
to CURL_POLL_IN or CURL_POLL_OUT via multi_getsock. That's where
https_getsock
is called and doesn't return any sockets.

I wonder why this issue did not pop up in any tests or for somebody else. I
assume it works fine when Curl_read_plain or Curl_write_plain always finish
immediately.
Are there any test_cases for schannel? I didn't got the testcases to work
on
windows properly, though.

Regards,

Christian

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Received on 2012-07-09