From 7828e81c7905a8e9b864c7e386c9ebadcb474b82 Mon Sep 17 00:00:00 2001 From: hniksic Date: Tue, 5 Dec 2000 15:09:41 -0800 Subject: [PATCH] [svn] Committed C. Frankel's SSL patch. --- AUTHORS | 2 + ChangeLog | 11 ++ INSTALL | 1 + TODO | 2 - configure | 384 +++++++++++++++++++++++++++++++----------------- configure.in | 17 +++ src/ChangeLog | 17 +++ src/Makefile.in | 3 +- src/config.h.in | 3 + src/connect.c | 2 +- src/ftp-ls.c | 48 +++--- src/http.c | 165 +++++++++++++++++++-- src/init.c | 2 + src/options.h | 2 +- src/rbuf.c | 23 ++- src/rbuf.h | 30 ++++ src/retr.c | 16 +- src/url.c | 12 +- src/wget.h | 4 +- 19 files changed, 562 insertions(+), 182 deletions(-) diff --git a/AUTHORS b/AUTHORS index ae371eda..a00b2219 100644 --- a/AUTHORS +++ b/AUTHORS @@ -17,3 +17,5 @@ authentication. Dan Harkless. Added --backup-converted, --follow-tags, --html-extension, --ignore-tags, and --page-requisites; improved documentation; etc. + +Christian Fraenkel. Implemented SSL support. diff --git a/ChangeLog b/ChangeLog index c2b880e5..540feea9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2000-12-05 Hrvoje Niksic + + * configure.in: Don't unconditionally define HAVE_SSL, even when + --with-ssl is given. + +2000-12-03 Christian Fraenkel + + * INSTALL: Added the --with-ssl switch + * configure.in: ditto + * TODO: Removed the corresponding entry + 2000-11-23 Hrvoje Niksic * configure.in: Build ALL_LINGUAS dynamically. diff --git a/INSTALL b/INSTALL index b9c56f13..c96f3999 100644 --- a/INSTALL +++ b/INSTALL @@ -29,6 +29,7 @@ scripts take. The most important ones are: --enable and --with options recognized (mostly Wget-specific): --with-socks use the socks library + --with-ssl use the openssl library --disable-opie disable support for opie or s/key FTP login --disable-digest disable support for HTTP digest authorization --disable-debug disable support for debugging output diff --git a/TODO b/TODO index 6b0858f6..85524996 100644 --- a/TODO +++ b/TODO @@ -110,5 +110,3 @@ changes. * Implement HTTP cookies. * Implement more HTTP/1.1 bells and whistles (ETag, Content-MD5 etc.) - -* Support SSL encryption through SSLeay or OpenSSL. diff --git a/configure b/configure index 1f3773fb..24fd41ea 100755 --- a/configure +++ b/configure @@ -13,6 +13,8 @@ ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help --with-socks use the socks library" +ac_help="$ac_help + --with-ssl use the openssl library" ac_help="$ac_help --disable-opie disable support for opie or s/key FTP login" ac_help="$ac_help @@ -566,7 +568,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:570: checking host system type" >&5 +echo "configure:572: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -601,6 +603,13 @@ EOF fi +# Check whether --with-ssl or --without-ssl was given. +if test "${with_ssl+set}" = set; then + withval="$with_ssl" + : +fi + + # Check whether --enable-opie or --disable-opie was given. if test "${enable_opie+set}" = set; then enableval="$enable_opie" @@ -651,7 +660,7 @@ fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:655: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:664: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -690,7 +699,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:694: checking for a BSD compatible install" >&5 +echo "configure:703: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -750,7 +759,7 @@ test -z "$CC" && cc_specified=yes # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:754: checking for $ac_word" >&5 +echo "configure:763: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -780,7 +789,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:784: checking for $ac_word" >&5 +echo "configure:793: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -831,7 +840,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:835: checking for $ac_word" >&5 +echo "configure:844: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -863,7 +872,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:867: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:876: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -874,12 +883,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 878 "configure" +#line 887 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:883: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:892: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -905,12 +914,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:909: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:918: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:914: checking whether we are using GNU C" >&5 +echo "configure:923: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -919,7 +928,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -938,7 +947,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:942: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:951: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -983,7 +992,7 @@ if test -n "$auto_cflags"; then fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:987: checking how to run the C preprocessor" >&5 +echo "configure:996: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -998,13 +1007,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1008: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1017: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1015,13 +1024,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1025: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1034: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1032,13 +1041,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1042: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1051: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1063,9 +1072,9 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1067: checking for AIX" >&5 +echo "configure:1076: checking for AIX" >&5 cat > conftest.$ac_ext <&6 -echo "configure:1099: checking for ${CC-cc} option to accept ANSI C" >&5 +echo "configure:1108: checking for ${CC-cc} option to accept ANSI C" >&5 if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1111,7 +1120,7 @@ for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__ do CC="$ac_save_CC $ac_arg" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1142: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* am_cv_prog_cc_stdc="$ac_arg"; break else @@ -1151,7 +1160,7 @@ esac echo $ac_n "checking for function prototypes""... $ac_c" 1>&6 -echo "configure:1155: checking for function prototypes" >&5 +echo "configure:1164: checking for function prototypes" >&5 if test "$am_cv_prog_cc_stdc" != no; then echo "$ac_t""yes" 1>&6 cat >> confdefs.h <<\EOF @@ -1164,12 +1173,12 @@ else U=_ ANSI2KNR=./ansi2knr # Ensure some checks needed by ansi2knr itself. echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1168: checking for ANSI C header files" >&5 +echo "configure:1177: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1177,7 +1186,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1181: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1190: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1194,7 +1203,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1212,7 +1221,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -1233,7 +1242,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1244,7 +1253,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1248: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1257: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1271,17 +1280,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1275: checking for $ac_hdr" >&5 +echo "configure:1284: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1285: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1294: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1311,12 +1320,12 @@ fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1315: checking for working const" >&5 +echo "configure:1324: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1378: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1386,12 +1395,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:1390: checking for size_t" >&5 +echo "configure:1399: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1419,12 +1428,12 @@ EOF fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:1423: checking for pid_t" >&5 +echo "configure:1432: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -1452,14 +1461,14 @@ EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1456: checking whether byte ordering is bigendian" >&5 +echo "configure:1465: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1470,11 +1479,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1483: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1485,7 +1494,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1489: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1498: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1505,7 +1514,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1544,7 +1553,7 @@ fi # Check size of long. echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:1548: checking size of long" >&5 +echo "configure:1557: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1552,7 +1561,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1563,7 +1572,7 @@ main() exit(0); } EOF -if { (eval echo configure:1567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1576: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -1583,7 +1592,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:1587: checking size of long long" >&5 +echo "configure:1596: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1591,7 +1600,7 @@ else { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext < main() @@ -1602,7 +1611,7 @@ main() exit(0); } EOF -if { (eval echo configure:1606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -1626,17 +1635,17 @@ for ac_hdr in string.h stdarg.h unistd.h sys/time.h utime.h sys/utime.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1630: checking for $ac_hdr" >&5 +echo "configure:1639: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1640: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1666,17 +1675,17 @@ for ac_hdr in sys/select.h sys/utsname.h pwd.h signal.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1670: checking for $ac_hdr" >&5 +echo "configure:1679: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1689: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1703,12 +1712,12 @@ fi done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1707: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1716: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1717,7 +1726,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1730: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1739,12 +1748,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1743: checking return type of signal handlers" >&5 +echo "configure:1752: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1761,7 +1770,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1765: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1774: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1781,10 +1790,10 @@ EOF echo $ac_n "checking for struct utimbuf""... $ac_c" 1>&6 -echo "configure:1785: checking for struct utimbuf" >&5 +echo "configure:1794: checking for struct utimbuf" >&5 if test x"$ac_cv_header_utime_h" = xyes; then cat > conftest.$ac_ext < EOF @@ -1809,19 +1818,19 @@ fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 -echo "configure:1813: checking for working alloca.h" >&5 +echo "configure:1822: checking for working alloca.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = alloca(2 * sizeof(int)); ; return 0; } EOF -if { (eval echo configure:1825: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_header_alloca_h=yes else @@ -1842,12 +1851,12 @@ EOF fi echo $ac_n "checking for alloca""... $ac_c" 1>&6 -echo "configure:1846: checking for alloca" >&5 +echo "configure:1855: checking for alloca" >&5 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_func_alloca_works=yes else @@ -1907,12 +1916,12 @@ EOF echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 -echo "configure:1911: checking whether alloca needs Cray hooks" >&5 +echo "configure:1920: checking whether alloca needs Cray hooks" >&5 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1941: checking for $ac_func" >&5 +echo "configure:1950: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1992,7 +2001,7 @@ done fi echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 -echo "configure:1996: checking stack direction for C alloca" >&5 +echo "configure:2005: checking stack direction for C alloca" >&5 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2000,7 +2009,7 @@ else ac_cv_c_stack_direction=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_stack_direction=1 else @@ -2044,17 +2053,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2048: checking for $ac_hdr" >&5 +echo "configure:2057: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2083,12 +2092,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2087: checking for $ac_func" >&5 +echo "configure:2096: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2124: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2136,7 +2145,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:2140: checking for working mmap" >&5 +echo "configure:2149: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2144,7 +2153,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2297: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2309,12 +2318,12 @@ fi for ac_func in strdup strstr strcasecmp strncasecmp do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2313: checking for $ac_func" >&5 +echo "configure:2322: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2364,12 +2373,12 @@ done for ac_func in gettimeofday mktime strptime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2368: checking for $ac_func" >&5 +echo "configure:2377: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2419,12 +2428,12 @@ done for ac_func in strerror snprintf vsnprintf select signal symlink access isatty do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2423: checking for $ac_func" >&5 +echo "configure:2432: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2460: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2474,12 +2483,12 @@ done for ac_func in uname gethostname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2478: checking for $ac_func" >&5 +echo "configure:2487: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2515: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2530,12 +2539,12 @@ done for ac_func in gethostbyname do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2534: checking for $ac_func" >&5 +echo "configure:2543: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2580,7 +2589,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:2584: checking for gethostbyname in -lnsl" >&5 +echo "configure:2593: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2588,7 +2597,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2633,7 +2642,7 @@ done echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:2637: checking for socket in -lsocket" >&5 +echo "configure:2646: checking for socket in -lsocket" >&5 ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2641,7 +2650,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2683,7 +2692,7 @@ fi if test "x${with_socks}" = xyes then echo $ac_n "checking for main in -lresolv""... $ac_c" 1>&6 -echo "configure:2687: checking for main in -lresolv" >&5 +echo "configure:2696: checking for main in -lresolv" >&5 ac_lib_var=`echo resolv'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2691,14 +2700,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2726,7 +2735,7 @@ else fi echo $ac_n "checking for Rconnect in -lsocks""... $ac_c" 1>&6 -echo "configure:2730: checking for Rconnect in -lsocks" >&5 +echo "configure:2739: checking for Rconnect in -lsocks" >&5 ac_lib_var=`echo socks'_'Rconnect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2734,7 +2743,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocks $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2774,11 +2783,117 @@ fi fi +if test "x${with_ssl}" = xyes +then + ssl_lose=no + echo $ac_n "checking for SSL_new in -lssl""... $ac_c" 1>&6 +echo "configure:2791: checking for SSL_new in -lssl" >&5 +ac_lib_var=`echo ssl'_'SSL_new | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lssl -lcrypto $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo ssl | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +ssl_lose=yes +fi + + echo $ac_n "checking for main in -lcrypto""... $ac_c" 1>&6 +echo "configure:2839: checking for main in -lcrypto" >&5 +ac_lib_var=`echo crypto'_'main | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lcrypto $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo crypto | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +ssl_lose=yes +fi + + if test "$ssl_lose" = no + then + cat >> confdefs.h <<\EOF +#define HAVE_SSL 1 +EOF + + SSL_OBJ='gen_sslfunc$o' + + fi +fi + ALL_LINGUAS=`(cd ${srcdir}/po && ls *.po | sed -e 's/\.po$//')` echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 -echo "configure:2782: checking whether NLS is requested" >&5 +echo "configure:2897: checking whether NLS is requested" >&5 # Check whether --enable-nls or --disable-nls was given. if test "${enable_nls+set}" = set; then enableval="$enable_nls" @@ -2795,7 +2910,7 @@ fi # Extract the first word of "msgfmt", so it can be a program name with args. set dummy msgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2799: checking for $ac_word" >&5 +echo "configure:2914: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2829,7 +2944,7 @@ fi # Extract the first word of "xgettext", so it can be a program name with args. set dummy xgettext; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2833: checking for $ac_word" >&5 +echo "configure:2948: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2864,7 +2979,7 @@ fi # Extract the first word of "gmsgfmt", so it can be a program name with args. set dummy gmsgfmt; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2868: checking for $ac_word" >&5 +echo "configure:2983: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2914,17 +3029,17 @@ fi do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2918: checking for $ac_hdr" >&5 +echo "configure:3033: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2928: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2954,12 +3069,12 @@ done for ac_func in gettext do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2958: checking for $ac_func" >&5 +echo "configure:3073: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3004,7 +3119,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 -echo "configure:3008: checking for gettext in -lintl" >&5 +echo "configure:3123: checking for gettext in -lintl" >&5 ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3012,7 +3127,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lintl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3091,7 +3206,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:3095: checking for $ac_word" >&5 +echo "configure:3210: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3279,6 +3394,7 @@ s%@exeext@%$exeext%g s%@U@%$U%g s%@ANSI2KNR@%$ANSI2KNR%g s%@ALLOCA@%$ALLOCA%g +s%@SSL_OBJ@%$SSL_OBJ%g s%@MSGFMT@%$MSGFMT%g s%@XGETTEXT@%$XGETTEXT%g s%@GMSGFMT@%$GMSGFMT%g diff --git a/configure.in b/configure.in index b63b14c3..2b76a49e 100644 --- a/configure.in +++ b/configure.in @@ -45,6 +45,9 @@ AC_ARG_WITH(socks, [ --with-socks use the socks library], [AC_DEFINE(HAVE_SOCKS)]) +AC_ARG_WITH(ssl, +[ --with-ssl use the openssl library]) + AC_ARG_ENABLE(opie, [ --disable-opie disable support for opie or s/key FTP login], USE_OPIE=$enableval, USE_OPIE=yes) @@ -183,6 +186,20 @@ then AC_CHECK_LIB(socks, Rconnect) fi +dnl check for ssl libraries +if test "x${with_ssl}" = xyes +then + ssl_lose=no + AC_CHECK_LIB(ssl,SSL_new,,ssl_lose=yes,-lcrypto) + AC_CHECK_LIB(crypto,main,,ssl_lose=yes) + if test "$ssl_lose" = no + then + AC_DEFINE(HAVE_SSL) + SSL_OBJ='gen_sslfunc$o' + AC_SUBST(SSL_OBJ) + fi +fi + dnl dnl Set of available languages. dnl diff --git a/src/ChangeLog b/src/ChangeLog index 75beaa36..1ad37a12 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,20 @@ +2000-12-03 Christian Fraenkel + + * Makefile.in: added gen_sslfunc object + * config.h.in: added HAVE_SSL define + * connect.c: changed select_fd from static int to int + * connect.h: ditto + * gen_sslfunc.h: New file + * gen_sslfunc.c: ditto + * http.c: added HTTPS fuctionality + * retrc.c: ditto + * url.c: ditto + * init.c: added opt.httpsproxy + * options.h: ditto + * rbuf.h: added alternate rbuf struct + * wget.h: added CONSSLERR + * rbuf.c: ditto + 2000-11-30 Jan Prikryl * ftp-ls.c (ftp_parse_unix_ls): Added second parameter diff --git a/src/Makefile.in b/src/Makefile.in index 0b899da8..7a825203 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -55,12 +55,13 @@ ETAGS = etags ALLOCA = @ALLOCA@ MD5_OBJ = @MD5_OBJ@ OPIE_OBJ = @OPIE_OBJ@ +SSL_OBJ = @SSL_OBJ@ OBJ = $(ALLOCA) cmpt$o connect$o fnmatch$o ftp$o ftp-basic$o \ ftp-ls$o $(OPIE_OBJ) ftpparse$o getopt$o hash$o \ headers$o host$o html-parse$o html-url$o http$o init$o \ log$o main$o $(MD5_OBJ) netrc$o rbuf$o recur$o retr$o \ - snprintf$o url$o utils$o version$o + snprintf$o $(SSL_OBJ) url$o utils$o version$o .SUFFIXES: .SUFFIXES: .c .o ._c ._o diff --git a/src/config.h.in b/src/config.h.in index ed200e32..ed25b959 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -218,4 +218,7 @@ char *alloca (); # define _SVID_SOURCE #endif +/* Define if all libs needed for ssl support are existing */ +#undef HAVE_SSL + #endif /* CONFIG_H */ diff --git a/src/connect.c b/src/connect.c index feb2bb52..6078f599 100644 --- a/src/connect.c +++ b/src/connect.c @@ -201,7 +201,7 @@ bindport (unsigned short *port) Returns 1 if FD is accessible, 0 for timeout and -1 for error in select(). */ -static int +int select_fd (int fd, int maxtime, int writep) { fd_set fds, exceptfds; diff --git a/src/ftp-ls.c b/src/ftp-ls.c index 4f0878f2..b6499e0b 100644 --- a/src/ftp-ls.c +++ b/src/ftp-ls.c @@ -490,37 +490,37 @@ ftp_parse_winnt_ls (const char *file) tok = strtok(NULL, " "); while (*tok == '\0') tok = strtok(NULL, " "); if (*tok == '<') - { - cur.type = FT_DIRECTORY; - cur.size = 0; - cur.perms = 493; /* my gcc does not like 0755 ?? */ - DEBUGP(("Directory\n")); - } + { + cur.type = FT_DIRECTORY; + cur.size = 0; + cur.perms = 493; /* my gcc does not like 0755 ?? */ + DEBUGP(("Directory\n")); + } else - { - cur.type = FT_PLAINFILE; - cur.size = atoi(tok); - cur.perms = 420; /* 0664 octal */ - DEBUGP(("File, size %ld bytes\n", cur.size)); - } + { + cur.type = FT_PLAINFILE; + cur.size = atoi(tok); + cur.perms = 420; /* 0664 octal */ + DEBUGP(("File, size %ld bytes\n", cur.size)); + } cur.linkto = NULL; /* And put everything into the linked list */ if (!dir) - { - l = dir = (struct fileinfo *)xmalloc (sizeof (struct fileinfo)); - memcpy (l, &cur, sizeof (cur)); - l->prev = l->next = NULL; - } + { + l = dir = (struct fileinfo *)xmalloc (sizeof (struct fileinfo)); + memcpy (l, &cur, sizeof (cur)); + l->prev = l->next = NULL; + } else - { - cur.prev = l; - l->next = (struct fileinfo *)xmalloc (sizeof (struct fileinfo)); - l = l->next; - memcpy (l, &cur, sizeof (cur)); - l->next = NULL; - } + { + cur.prev = l; + l->next = (struct fileinfo *)xmalloc (sizeof (struct fileinfo)); + l = l->next; + memcpy (l, &cur, sizeof (cur)); + l->next = NULL; + } xfree(line); } diff --git a/src/http.c b/src/http.c index b487cbc4..71706e1d 100644 --- a/src/http.c +++ b/src/http.c @@ -44,6 +44,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ # endif #endif +#ifdef HAVE_SSL +#include "gen_sslfunc.h" +#endif /* HAVE_SSL */ + #ifdef WINDOWS # include #endif @@ -269,7 +273,6 @@ http_process_connection (const char *hdr, void *arg) /* Whether a persistent connection is active. */ static int pc_active_p; - /* Host and port of currently active persistent connection. */ static unsigned char pc_last_host[4]; static unsigned short pc_last_port; @@ -277,6 +280,13 @@ static unsigned short pc_last_port; /* File descriptor of the currently active persistent connection. */ static int pc_last_fd; +#ifdef HAVE_SSL +/* Whether a ssl handshake has occoured on this connection */ +static int pc_active_ssl; +/* SSL connection of the currently active persistent connection. */ +static SSL *pc_last_ssl; +#endif /* HAVE_SSL */ + /* Mark the persistent connection as invalid. This is used by the CLOSE_* macros after they forcefully close a registered persistent connection. This does not close the file descriptor -- it is left @@ -286,6 +296,9 @@ static void invalidate_persistent (void) { pc_active_p = 0; +#ifdef HAVE_SSL + pc_active_ssl = 0; +#endif /* HAVE_SSL */ DEBUGP (("Invalidating fd %d from further reuse.\n", pc_last_fd)); } @@ -298,7 +311,11 @@ invalidate_persistent (void) If a previous connection was persistent, it is closed. */ static void +#ifndef HAVE_SSL register_persistent (const char *host, unsigned short port, int fd) +#else +register_persistent (const char *host, unsigned short port, int fd, SSL* ssl) +#endif /* HAVE_SSL */ { int success; @@ -317,6 +334,10 @@ register_persistent (const char *host, unsigned short port, int fd) persistent connection exists, but we then connect to a different host, and try to register a persistent connection to that one. */ +#ifdef HAVE_SSL + /* the ssl disconnect has to take place before the closing of pc_last_fd */ + if (pc_last_ssl) shutdown_ssl(pc_last_ssl); +#endif /* HAVE_SSL */ CLOSE (pc_last_fd); invalidate_persistent (); } @@ -329,6 +350,10 @@ register_persistent (const char *host, unsigned short port, int fd) pc_last_port = port; pc_last_fd = fd; pc_active_p = 1; +#ifdef HAVE_SSL + pc_last_ssl=ssl; + pc_active_ssl= ssl ? 1 : 0; +#endif /* HAVE_SSL */ DEBUGP (("Registered fd %d for persistent reuse.\n", fd)); } @@ -336,7 +361,11 @@ register_persistent (const char *host, unsigned short port, int fd) connecting to HOST:PORT. */ static int +#ifndef HAVE_SSL persistent_available_p (const char *host, unsigned short port) +#else +persistent_available_p (const char *host, unsigned short port,int ssl) +#endif /* HAVE_SSL */ { unsigned char this_host[4]; /* First, check whether a persistent connection is active at all. */ @@ -365,6 +394,15 @@ persistent_available_p (const char *host, unsigned short port) invalidate_persistent (); return 0; } +#ifdef HAVE_SSL + /* Fourth: check if current connection is (not) ssl, too. + This test is unlikely to fail because HTTP and HTTPS + typicaly use different ports. Yet it is possible (or so + I have been told) to run HTTPS and HTTP simultaneus on + the same port. */ + if (ssl!=pc_active_ssl) + return 0; +#endif /* HAVE_SSL */ return 1; } @@ -383,6 +421,7 @@ persistent_available_p (const char *host, unsigned short port) `pc_active_p && (fd) == pc_last_fd' is "we're *now* using an active, registered connection". */ +#ifndef HAVE_SSL #define CLOSE_FINISH(fd) do { \ if (!keep_alive) \ { \ @@ -398,6 +437,25 @@ persistent_available_p (const char *host, unsigned short port) invalidate_persistent (); \ } while (0) +#else + +#define CLOSE_FINISH(fd,ssl) do { \ + if (!keep_alive) \ + { \ + if (ssl) shutdown_ssl(ssl); \ + CLOSE (fd); \ + if (pc_active_p && (fd) == pc_last_fd) \ + invalidate_persistent (); \ + } \ +} while (0) + +#define CLOSE_INVALIDATE(fd,ssl) do { \ + if (ssl) shutdown_ssl(ssl); \ + CLOSE (fd); \ + if (pc_active_p && (fd) == pc_last_fd) \ + invalidate_persistent (); \ +} while (0) +#endif /* HAVE_SSL */ struct http_stat { @@ -466,6 +524,10 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt) FILE *fp; int auth_tried_already; struct rbuf rbuf; +#ifdef HAVE_SSL + static SSL_CTX *ssl_ctx=NULL; + SSL *ssl=NULL; +#endif /* HAVE_SSL */ /* Whether this connection will be kept alive after the HTTP request is done. */ @@ -478,6 +540,11 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt) /* Whether keep-alive should be inhibited. */ int inhibit_keep_alive; +#ifdef HAVE_SSL +/* initialize ssl_ctx on first run */ + if (!ssl_ctx) init_ssl(&ssl_ctx); +#endif /* HAVE_SSL */ + if (!(*dt & HEAD_ONLY)) /* If we're doing a GET on the URL, as opposed to just a HEAD, we need to know the local filename so we can save to it. */ @@ -512,11 +579,15 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt) /* First: establish the connection. */ if (inhibit_keep_alive +#ifndef HAVE_SSL || !persistent_available_p (u->host, u->port)) +#else + || !persistent_available_p (u->host, u->port, (u->proto==URLHTTPS ? 1 : 0))) +#endif /* HAVE_SSL */ { logprintf (LOG_VERBOSE, _("Connecting to %s:%hu... "), u->host, u->port); err = make_connection (&sock, u->host, u->port); - switch (err) + switch (err) { case HOSTERR: logputs (LOG_VERBOSE, "\n"); @@ -548,6 +619,14 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt) abort (); break; } +#ifdef HAVE_SSL + if (u->proto==URLHTTPS) if (connect_ssl(&ssl,ssl_ctx,sock)!=0) { + logputs (LOG_VERBOSE, "\n"); + logprintf (LOG_NOTQUIET, _("Unable to establish SSL connection.\n")); + CLOSE (sock); + return CONSSLERR; + } +#endif /* HAVE_SSL */ } else { @@ -555,6 +634,9 @@ gethttp (struct urlinfo *u, struct http_stat *hs, int *dt) /* #### pc_last_fd should be accessed through an accessor function. */ sock = pc_last_fd; +#ifdef HAVE_SSL + ssl = pc_last_ssl; +#endif /* HAVE_SSL */ DEBUGP (("Reusing fd %d.\n", sock)); } @@ -715,12 +797,24 @@ Accept: %s\r\n\ FREE_MAYBE (proxyauth); /* Send the request to server. */ +#ifdef HAVE_SSL + if (u->proto==URLHTTPS) { + num_written = ssl_iwrite (ssl, request, strlen (request)); + } else { +#endif /* HAVE_SSL */ num_written = iwrite (sock, request, strlen (request)); +#ifdef HAVE_SSL + } +#endif /* HAVE_SSL */ if (num_written < 0) { logprintf (LOG_VERBOSE, _("Failed writing HTTP request: %s.\n"), strerror (errno)); - CLOSE_INVALIDATE (sock); +#ifndef HAVE_SSL + CLOSE_INVALIDATE (sock); +#else + CLOSE_INVALIDATE (sock,ssl); +#endif /* HAVE_SSL */ return WRITEFAILED; } logprintf (LOG_VERBOSE, _("%s request sent, awaiting response... "), @@ -732,7 +826,11 @@ Accept: %s\r\n\ /* Before reading anything, initialize the rbuf. */ rbuf_initialize (&rbuf, sock); - +#ifdef HAVE_SSL + if (u->proto == URLHTTPS) { + rbuf.ssl=ssl; + } else { rbuf.ssl=NULL; } +#endif /* HAVE_SSL */ all_headers = NULL; all_length = 0; /* Header-fetching loop. */ @@ -767,7 +865,11 @@ Accept: %s\r\n\ FREE_MAYBE (type); FREE_MAYBE (hs->newloc); FREE_MAYBE (all_headers); - CLOSE_INVALIDATE (sock); +#ifndef HAVE_SSL + CLOSE_INVALIDATE (sock); +#else + CLOSE_INVALIDATE (sock,ssl); +#endif /* HAVE_SSL */ return HEOF; } else if (status == HG_ERROR) @@ -779,7 +881,11 @@ Accept: %s\r\n\ FREE_MAYBE (type); FREE_MAYBE (hs->newloc); FREE_MAYBE (all_headers); - CLOSE_INVALIDATE (sock); +#ifndef HAVE_SSL + CLOSE_INVALIDATE (sock); +#else + CLOSE_INVALIDATE (sock,ssl); +#endif /* HAVE_SSL */ return HERR; } @@ -919,7 +1025,11 @@ Accept: %s\r\n\ if (keep_alive) /* The server has promised that it will not close the connection when we're done. This means that we can register it. */ +#ifndef HAVE_SSL register_persistent (u->host, u->port, sock); +#else + register_persistent (u->host, u->port, sock, ssl); +#endif /* HAVE_SSL */ if ((statcode == HTTP_STATUS_UNAUTHORIZED) && authenticate_h) @@ -928,7 +1038,11 @@ Accept: %s\r\n\ FREE_MAYBE (type); type = NULL; FREEHSTAT (*hs); - CLOSE_FINISH (sock); +#ifndef HAVE_SSL + CLOSE_FINISH (sock); +#else + CLOSE_FINISH (sock,ssl); +#endif /* HAVE_SSL */ if (auth_tried_already) { /* If we have tried it already, then there is not point @@ -1004,7 +1118,11 @@ Accept: %s\r\n\ FREE_MAYBE (type); FREE_MAYBE (hs->newloc); FREE_MAYBE (all_headers); - CLOSE_INVALIDATE (sock); +#ifndef HAVE_SSL + CLOSE_INVALIDATE (sock); +#else + CLOSE_INVALIDATE (sock,ssl); +#endif /* HAVE_SSL */ return RANGEERR; } @@ -1034,7 +1152,11 @@ Accept: %s\r\n\ _("Location: %s%s\n"), hs->newloc ? hs->newloc : _("unspecified"), hs->newloc ? _(" [following]") : ""); - CLOSE_FINISH (sock); +#ifndef HAVE_SSL + CLOSE_FINISH (sock); +#else + CLOSE_FINISH (sock,ssl); +#endif /* HAVE_SSL */ FREE_MAYBE (type); FREE_MAYBE (all_headers); return NEWLOCATION; @@ -1075,7 +1197,11 @@ Accept: %s\r\n\ hs->res = 0; FREE_MAYBE (type); FREE_MAYBE (all_headers); - CLOSE_FINISH (sock); +#ifndef HAVE_SSL + CLOSE_FINISH (sock); +#else + CLOSE_FINISH (sock,ssl); +#endif /* HAVE_SSL */ return RETRFINISHED; } @@ -1089,7 +1215,11 @@ Accept: %s\r\n\ if (!fp) { logprintf (LOG_NOTQUIET, "%s: %s\n", u->local, strerror (errno)); - CLOSE_FINISH (sock); +#ifndef HAVE_SSL + CLOSE_FINISH (sock); +#else + CLOSE_FINISH (sock,ssl); +#endif /* HAVE_SSL */ FREE_MAYBE (all_headers); return FOPENERR; } @@ -1129,7 +1259,11 @@ Accept: %s\r\n\ hs->res = -2; } FREE_MAYBE (all_headers); - CLOSE_FINISH (sock); +#ifndef HAVE_SSL + CLOSE_FINISH (sock); +#else + CLOSE_FINISH (sock,ssl); +#endif /* HAVE_SSL */ if (hs->res == -2) return FWRITEERR; return RETRFINISHED; @@ -1350,6 +1484,13 @@ File `%s' already there, will not retrieve.\n"), u->local); logprintf (LOG_NOTQUIET, _("Cannot write to `%s' (%s).\n"), u->local, strerror (errno)); FREEHSTAT (hstat); + return err; + break; + case CONSSLERR: + /* Another fatal error. */ + logputs (LOG_VERBOSE, "\n"); + logprintf (LOG_NOTQUIET, _("Unable to establish SSL connection.\n")); + FREEHSTAT (hstat); xfree (filename_plus_orig_suffix); /* must precede every return! */ return err; break; diff --git a/src/init.c b/src/init.c index 54435c1a..64218de7 100644 --- a/src/init.c +++ b/src/init.c @@ -126,6 +126,7 @@ static struct { { "httppasswd", &opt.http_passwd, cmd_string }, { "httpproxy", &opt.http_proxy, cmd_string }, { "httpuser", &opt.http_user, cmd_string }, + { "httpsproxy", &opt.https_proxy, cmd_string }, { "ignorelength", &opt.ignore_length, cmd_boolean }, { "ignoretags", &opt.ignore_tags, cmd_vector }, { "includedirectories", &opt.includes, cmd_directory_vector }, @@ -1012,6 +1013,7 @@ cleanup (void) xfree (opt.ftp_acc); FREE_MAYBE (opt.ftp_pass); FREE_MAYBE (opt.ftp_proxy); + FREE_MAYBE (opt.https_proxy); FREE_MAYBE (opt.http_proxy); free_vec (opt.no_proxy); FREE_MAYBE (opt.useragent); diff --git a/src/options.h b/src/options.h index db849579..e080adb0 100644 --- a/src/options.h +++ b/src/options.h @@ -90,7 +90,7 @@ struct options int use_proxy; /* Do we use proxy? */ int proxy_cache; /* Do we load from proxy cache? */ - char *http_proxy, *ftp_proxy; + char *http_proxy, *ftp_proxy, *https_proxy; char **no_proxy; char *base_href; char *proxy_user; /*oli*/ diff --git a/src/rbuf.c b/src/rbuf.c index b8fefb13..b0ed3cab 100644 --- a/src/rbuf.c +++ b/src/rbuf.c @@ -25,10 +25,23 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "rbuf.h" #include "connect.h" +#ifdef HAVE_SSL +#include +#include +#include +#include +#include +#include +#endif /* HAVE_SSL */ + void rbuf_initialize (struct rbuf *rbuf, int fd) { rbuf->fd = fd; +#ifdef HAVE_SSL +/* pointing ssl to NULL results in an unchanged behaviour */ + rbuf->ssl = NULL; +#endif /* HAVE_SSL */ rbuf->buffer_pos = rbuf->buffer; rbuf->buffer_left = 0; } @@ -64,7 +77,15 @@ rbuf_peek (struct rbuf *rbuf, char *store) int res; rbuf->buffer_pos = rbuf->buffer; rbuf->buffer_left = 0; - res = iread (rbuf->fd, rbuf->buffer, sizeof (rbuf->buffer)); +#ifdef HAVE_SSL + if (rbuf->ssl != NULL) { + res = ssl_iread (rbuf->ssl, rbuf->buffer, sizeof (rbuf->buffer)); + } else { +#endif /* HAVE_SSL */ + res = iread (rbuf->fd, rbuf->buffer, sizeof (rbuf->buffer)); +#ifdef HAVE_SSL + } +#endif /* HAVE_SSL */ if (res <= 0) return res; rbuf->buffer_left = res; diff --git a/src/rbuf.h b/src/rbuf.h index 44e5bd0e..415933ce 100644 --- a/src/rbuf.h +++ b/src/rbuf.h @@ -20,10 +20,17 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef RBUF_H #define RBUF_H +#ifdef HAVE_SSL +# include +#endif + /* Retrieval stream */ struct rbuf { int fd; +#ifdef HAVE_SSL + SSL *ssl; /* the ssl structure -- replaces fd for ssl connections */ +#endif /* HAVE_SSL */ char buffer[4096]; /* the input buffer */ char *buffer_pos; /* current position in the buffer */ size_t buffer_left; /* number of bytes left in the buffer: @@ -42,6 +49,23 @@ struct rbuf result of historical implementation of header code. The macro should return the character or EOF, and in case of error store it to rbuf->err or something. */ +#ifdef HAVE_SSL +/* SSL version of rbuf. If rbuf.ssl isn't NULL use ssl_iread instead + of iread */ +#define RBUF_READCHAR(rbuf, store) \ +((rbuf)->buffer_left \ + ? (--(rbuf)->buffer_left, \ + *((char *) (store)) = *(rbuf)->buffer_pos++, 1) \ + : ((rbuf)->buffer_pos = (rbuf)->buffer, \ + ((((rbuf)->internal_dont_touch_this \ + = (rbuf->ssl == NULL) ? (iread ((rbuf)->fd, (rbuf)->buffer, \ + sizeof ((rbuf)->buffer))) : (ssl_iread ((rbuf)->ssl, (rbuf)->buffer, \ + sizeof ((rbuf)->buffer))) ) <= 0) \ + ? (rbuf)->internal_dont_touch_this \ + : ((rbuf)->buffer_left = (rbuf)->internal_dont_touch_this - 1, \ + *((char *) (store)) = *(rbuf)->buffer_pos++, \ + 1)))) +#else #define RBUF_READCHAR(rbuf, store) \ ((rbuf)->buffer_left \ ? (--(rbuf)->buffer_left, \ @@ -55,9 +79,15 @@ struct rbuf *((char *) (store)) = *(rbuf)->buffer_pos++, \ 1)))) + +#endif /* HAVE_SSL */ + /* Return the file descriptor of RBUF. */ #define RBUF_FD(rbuf) ((rbuf)->fd) +/* Return the file descriptor of RBUF. */ +#define RBUF_SSL(rbuf) ((rbuf)->ssl) + /* Function declarations */ void rbuf_initialize PARAMS ((struct rbuf *, int)); int rbuf_initialized_p PARAMS ((struct rbuf *)); diff --git a/src/retr.c b/src/retr.c index 800ee5d3..ffc2ecac 100644 --- a/src/retr.c +++ b/src/retr.c @@ -118,7 +118,15 @@ get_contents (int fd, FILE *fp, long *len, long restval, long expected, int amount_to_read = (use_expected ? MIN (expected - *len, sizeof (c)) : sizeof (c)); - res = iread (fd, c, amount_to_read); +#ifdef HAVE_SSL + if (rbuf->ssl!=NULL) { + res = ssl_iread (rbuf->ssl, c, amount_to_read); + } else { +#endif /* HAVE_SSL */ + res = iread (fd, c, amount_to_read); +#ifdef HAVE_SSL + } +#endif /* HAVE_SSL */ if (res > 0) { if (fwrite (c, sizeof (char), res, fp) < res) @@ -322,7 +330,7 @@ rate (long bytes, long msecs) && no_proxy_match((u)->host, \ (const char **)opt.no_proxy)) -/* Retrieve the given URL. Decides which loop to call -- HTTP, FTP, +/* Retrieve the given URL. Decides which loop to call -- HTTP(S), FTP, or simply copy it with file:// (#### the latter not yet implemented!). */ uerr_t @@ -415,7 +423,11 @@ retrieve_url (const char *origurl, char **file, char **newloc, assert (u->proto != URLFILE); /* #### Implement me! */ mynewloc = NULL; +#ifdef HAVE_SSL + if (u->proto == URLHTTP || u->proto == URLHTTPS ) +#else if (u->proto == URLHTTP) +#endif /* HAVE_SSL */ result = http_loop (u, &mynewloc, dt); else if (u->proto == URLFTP) { diff --git a/src/url.c b/src/url.c index eea36a10..0cbc3cd1 100644 --- a/src/url.c +++ b/src/url.c @@ -46,6 +46,7 @@ extern int errno; /* Default port definitions */ #define DEFAULT_HTTP_PORT 80 #define DEFAULT_FTP_PORT 21 +#define DEFAULT_HTTPS_PORT 443 /* Table of Unsafe chars. This is intialized in init_unsafe_char_table. */ @@ -77,8 +78,8 @@ static void path_simplify_with_kludge PARAMS ((char *)); static int urlpath_length PARAMS ((const char *)); /* NULL-terminated list of strings to be recognized as prototypes (URL - schemes). Note that recognized doesn't mean supported -- only HTTP - and FTP are currently supported. + schemes). Note that recognized doesn't mean supported -- only HTTP, + HTTPS and FTP are currently supported . However, a string that does not match anything in the list will be considered a relative URL. Thus it's important that this list has @@ -133,6 +134,9 @@ struct proto static struct proto sup_protos[] = { { "http://", URLHTTP, DEFAULT_HTTP_PORT }, +#ifdef HAVE_SSL + { "https://",URLHTTPS, DEFAULT_HTTPS_PORT}, +#endif { "ftp://", URLFTP, DEFAULT_FTP_PORT }, /*{ "file://", URLFILE, DEFAULT_FTP_PORT },*/ }; @@ -1288,6 +1292,10 @@ getproxy (uerr_t proto) return opt.http_proxy ? opt.http_proxy : getenv ("http_proxy"); else if (proto == URLFTP) return opt.ftp_proxy ? opt.ftp_proxy : getenv ("ftp_proxy"); +#ifdef HAVE_SSL + else if (proto == URLHTTPS) + return opt.https_proxy ? opt.https_proxy : getenv ("https_proxy"); +#endif /* HAVE_SSL */ else return NULL; } diff --git a/src/wget.h b/src/wget.h index b3c9ca05..4bb92f04 100644 --- a/src/wget.h +++ b/src/wget.h @@ -246,12 +246,12 @@ enum This is, of course, utter crock. */ typedef enum { - NOCONERROR, HOSTERR, CONSOCKERR, CONERROR, + NOCONERROR, HOSTERR, CONSOCKERR, CONERROR, CONSSLERR, CONREFUSED, NEWLOCATION, NOTENOUGHMEM, CONPORTERR, BINDERR, BINDOK, LISTENERR, ACCEPTERR, ACCEPTOK, CONCLOSED, FTPOK, FTPLOGINC, FTPLOGREFUSED, FTPPORTERR, FTPNSFOD, FTPRETROK, FTPUNKNOWNTYPE, FTPRERR, - FTPREXC, FTPSRVERR, FTPRETRINT, FTPRESTFAIL, + FTPREXC, FTPSRVERR, FTPRETRINT, FTPRESTFAIL, URLHTTPS, URLOK, URLHTTP, URLFTP, URLFILE, URLUNKNOWN, URLBADPORT, URLBADHOST, FOPENERR, FWRITEERR, HOK, HLEXC, HEOF, HERR, RETROK, RECLEVELEXC, FTPACCDENIED, WRONGCODE, -- 2.39.2