cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-tracker mailing list Archives

[ curl-Bugs-3110991 ] gnutls_handshake() error on Windows

From: SourceForge.net <noreply_at_sourceforge.net>
Date: Wed, 17 Nov 2010 20:06:34 +0000

Bugs item #3110991, was opened at 2010-11-17 21:06
Message generated for change (Tracker Item Submitted) made by photron
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3110991&group_id=976

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: SSL/TLS
Group: portability problem
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Matthias Bolte (photron)
Assigned to: Daniel Stenberg (bagder)
Summary: gnutls_handshake() error on Windows

Initial Comment:
When curl is complied with GnuTLS on Windows then trying to access https://www.google.com (for example) fails with a gnutls_handshake() error:

$ curl -kv https://www.google.com
* timeout on name lookup is not supported
* About to connect() to www.google.com port 443 (#0)
* Trying 66.249.92.104... connected
* Connected to www.google.com (66.249.92.104) port 443 (#0)
* gnutls_handshake() failed: A TLS packet with unexpected length was received.
* gnutls_handshake() failed: The specified session has been invalidated for some reason.

The last line is then repeated over and over again.

I traced this problem down to this commit from 2006:

https://github.com/bagder/curl/commit/fcccf9aa0d93c666e8ae31ebdde716cddd6b4482

By adding custom pull/push functions this commit also overrides the WSAGetLastError()-to-errno translation GnuTLS does on Windows. This causes the handshake error. When I copy the WSAGetLastError()-to-errno translation from GnuTLS (lib/gnutls_buffers.c _gnutls_read) to the custom pull/push functions then this problem is fixed and curl -kv https://www.google.com works as expected.

Some version information: This is on a Windows XP 32bit system with

$ curl --version
curl 7.21.2 (i686-pc-mingw32) libcurl/7.21.2 GnuTLS/2.10.1 zlib/1.2.4
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp smtp smtps telnet tftp
Features: Largefile NTLM SSL libz

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=100976&aid=3110991&group_id=976
Received on 2010-11-17

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET