cURL / Mailing Lists / curl-library / Single Mail

curl-library

TCP/SSL error when connecting to outlook.office365.com

From: Jeff McKay <jjmckay_at_comaxis.com>
Date: Wed, 13 Nov 2013 21:22:24 -0800

I've got an application that uses CURL to connect to Office 365 (via
Exchange Web Services). Recently I have started to see
a problem when trying to POST a large message. Looking at the debug
messages I see multiple infotype=4, 16k chunks of
data going out, then I get SSL read:
error:00000000:lib(0):func(0):reason(0), errno 10053. CURL tries to
recover but it
doesn't last long, and eventually my program hangs (the last debug line:
infotype=1: HTTP/1.1 100 Continue).

I tried switching to WinSSL from OpenSSL but it still fails, just with
different error messages.

Using this exactly same program to connect to a private server running
Exchange 2013 (over the internet ) works just
fine. For all the world this looks to me like some problem with
Microsoft's Office 365 servers, but I need to do something
to work around it. Any ideas on settings I can use to fix this?

Here are the CURL options:

       curl_easy_setopt(curl, CURLOPT_URL, url);
        curl_easy_setopt(curl, CURLOPT_USERAGENT, gAgent);
        curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
        curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT, gConnectTimeout);
        curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1);
        curl_easy_setopt(curl, CURLOPT_MAXREDIRS, 50);
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, WriteMemoryCallback);
        curl_easy_setopt(curl, CURLOPT_READFUNCTION, ReadMemoryCallback);
        curl_easy_setopt(curl, CURLOPT_SSLENGINE_DEFAULT, 1);
        curl_easy_setopt(curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_SSLv3);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
        curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0);
        curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1);
        curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
        curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
        curl_easy_setopt(curl, CURLOPT_POST, 1);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDS, NULL);
        curl_easy_setopt(curl, CURLOPT_HTTPHEADER, gslist);
        curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (curl_off_t)fsize);
        curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, HttpHeaderData);

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-11-14