cURL / Mailing Lists / curl-library / Single Mail

curl-library

[Patch] fix test cases with NSS

From: Rob Crittenden <rcritten_at_redhat.com>
Date: Thu, 24 May 2007 15:37:35 -0400

Addresses bug http://curl.haxx.se/bug/view.cgi?id=1705802

Tested on Fedora Core 6.

./configure --without-ssl --with-nss
...
make check
...
srcdir=. /usr/bin/perl -I. ./runtests.pl -s -a
********* System characteristics ********
* curl 7.16.3-CVS (i686-redhat-linux-gnu)
* libcurl/7.16.3-CVS NSS/3.11.5 zlib/1.2.3 libidn/0.6.5
* Features: IDN IPv6 Largefile SSL libz
* Host: darlene
* System: Linux darlene 2.6.20-1.2948.fc6 #1 SMP Fri Apr 27 19:48:40 EDT
2007 i686 i686 i386 GNU/Linux
* Server SSL: ON
* libcurl SSL: ON
* libcurl debug: OFF
* valgrind: OFF
* HTTP IPv6 ON
* FTP IPv6 ON
* HTTP port: 8990
* FTP port: 8992
* FTP port 2: 8995
* FTPS port: 8993
* HTTPS port: 8991
* HTTP IPv6 port: 8994
* FTP IPv6 port: 8996
* TFTP port: 8997
* SCP/SFTP port: 8999
* SSL library: NSS
* Libtool lib: ON
*****************************************
...
...
TESTDONE: 316 tests out of 316 reported OK: 100%
TESTDONE: 362 tests were considered during 259 seconds.
TESTINFO: 46 tests were skipped due to these restraints:
TESTINFO: "rlimit problem: fds needed 1050 > system limit 1024" 1 times
(518)
TESTINFO: "curl lacks scp support" 4 times (601, 603, 605, 607)
TESTINFO: "curl lacks netrc_debug support" 6 times (130, 131, 132, 133,
134, 257)
TESTINFO: "curl lacks sftp support" 11 times (600, 602, 604, 606, 608,
609, 610, 611, 612, 613, 614)
TESTINFO: "curl lacks OpenSSL support" 3 times (307, 308, 509)
TESTINFO: "curl lacks NTLM support" 21 times (67, 68, 69, 70, 81, 89,
90, 91, 150, 155, 159, 162, 169, 170, 176, 209, 213, 239, 243, 265, 267)

Index: lib/nss.c
===================================================================
RCS file: /cvsroot/curl/curl/lib/nss.c,v
retrieving revision 1.4
diff -u -r1.4 nss.c
--- lib/nss.c 26 Feb 2007 04:24:26 -0000 1.4
+++ lib/nss.c 24 May 2007 19:28:42 -0000
@@ -74,6 +74,8 @@
 static int initialized = 0;
 static int noverify = 0;
 
+#define HANDSHAKE_TIMEOUT 30
+
 typedef struct {
   PRInt32 retryCount;
   struct SessionHandle *data;
@@ -513,6 +515,10 @@
 
   SSL_SetURL(connssl->handle, conn->host.name);
 
+ /* Force the handshake now */
+ if (SSL_ForceHandshakeWithTimeout(connssl->handle, PR_SecondsToInterval(HANDSHAKE_TIMEOUT)) != SECSuccess)
+ goto error;
+
   return CURLE_OK;
 
 error:

Received on 2007-05-24