Skip to content
Permalink
Browse files

libwww: update to 5.4.2

* Patches are from FreeBSD [1]. Also switch the FreeBSD approach to
  specify OpenSSL path. It's simpler.
* Builds without ltconfig13 and ltmain13. Those are added 17 years
  ago [2].  I believe the issue has been fixed or is no longer
  relevant. Also, upstream ltmain is much newer than ltmain13.
* libwww-config.in.diff: not needed as the library order is fixed
  in 5.4.2.
* patch-configure.diff: there is no ac_tr_hdr in 5.4.2.

Note that some HTTPS sites are not working. For example,
`webbot https://www.macports.org` works but
`webbot https://httpbin.org/` fails with "unable to get local
issuer certificate".

Closes: https://trac.macports.org/ticket/58980

[1] https://svnweb.freebsd.org/ports/head/www/libwww/files/
[2] e78a648#diff-4daf6f089f884dca3cee10a133a62626
  • Loading branch information...
yan12125 committed Sep 10, 2019
1 parent 73040f7 commit f0f3b771f5cd8b403acf596ec5a67e44d832a7bc
@@ -3,8 +3,8 @@
PortSystem 1.0

name libwww
version 5.4.0
revision 5
version 5.4.2
revision 0
categories www
license W3C
platforms darwin
@@ -17,37 +17,24 @@ long_description \
With a highly extensible and layered API, it can accommodate many different types \
of applications including clients, robots, etc.

master_sites http://www.w3.org/Library/Distribution/ \
macports:lt:lt
master_sites https://www.w3.org/Library/Distribution/
distname w3c-${distname}
extract.suffix .tgz
extract.only ${distfiles}

depends_build port:pkgconfig
depends_lib path:lib/libssl.dylib:openssl
distfiles-append ltconfig13:lt \
ltmain13:lt

checksums ${distname}${extract.suffix} \
md5 c3734ca6caa405707e134cc8c6d7e422 \
ltconfig13 \
md5 ea53f42a550c9f9e653758a8ed91574e \
ltmain13 \
md5 e094ae92724c4015dbab97de151c2525
checksums rmd160 7b6ecfbd84ca8b2ce3b19d3b60e9f6a75ea914f5 \
sha256 32b855101f65466c67ae3a3cc0fd18fa982e4b59fc98c9d4691e2da663d05f04 \
size 2630357

patchfiles patch-configure.diff \
libwww-config.in.diff

post-patch {
system "cp ${distpath}/ltconfig13 ${worksrcpath}/config/ltconfig"
system "cp ${distpath}/ltmain13 ${worksrcpath}/config/ltmain.sh"
reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/configure
}
patch-Library_src_SSL_HTSSL.c.diff

configure.args --enable-shared \
--enable-static \
--with-zlib \
--with-ssl
--with-ssl=${prefix}
configure.ccache no

pre-build {

This file was deleted.

@@ -0,0 +1,55 @@
--- Library/src/SSL/HTSSL.c.orig 2017-06-24 05:51:38 UTC
+++ Library/src/SSL/HTSSL.c
@@ -98,6 +98,7 @@ PRIVATE void apps_ssl_info_callback (SSL * s, int wher
PRIVATE int verify_callback (int ok, X509_STORE_CTX * ctx)
{
char buf[256];
+ int ctx_error;
X509 * err_cert = X509_STORE_CTX_get_current_cert(ctx);
int err = X509_STORE_CTX_get_error(ctx);
int depth = X509_STORE_CTX_get_error_depth(ctx);
@@ -115,24 +116,28 @@ PRIVATE int verify_callback (int ok, X509_STORE_CTX *
verify_error=X509_V_ERR_CERT_CHAIN_TOO_LONG;
}
}
- switch (ctx->error) {
+ switch (ctx_error = X509_STORE_CTX_get_error(ctx)) {

case X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT:
+#if OPENSSL_VERSION_NUMBER >= 0x10100000
+ X509_NAME_oneline(X509_get_issuer_name(X509_STORE_CTX_get0_cert(ctx)), buf, 256);
+#else
X509_NAME_oneline(X509_get_issuer_name(ctx->current_cert), buf, 256);
+#endif
HTTRACE(PROT_TRACE, "issuer= %s\n" _ buf);
break;

case X509_V_ERR_CERT_NOT_YET_VALID:
case X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD:
HTTRACE(PROT_TRACE, "notBefore=");
-// ASN1_TIME_print(bio_err,X509_get_notBefore(ctx->current_cert));
+// ASN1_TIME_print(bio_err,X509_get_notBefore(X509_STORE_CTX_get0_cert(ctx)));
HTTRACE(PROT_TRACE, "\n");
break;

case X509_V_ERR_CERT_HAS_EXPIRED:
case X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD:
HTTRACE(PROT_TRACE, "notAfter=");
-// ASN1_TIME_print(bio_err,X509_get_notAfter(ctx->current_cert));
+// ASN1_TIME_print(bio_err,X509_get_notAfter(X509_STORE_CTX_get0_cert(ctx)));
HTTRACE(PROT_TRACE, "\n");
break;
}
@@ -214,12 +219,6 @@ PUBLIC BOOL HTSSL_init (void)

/* select the protocol method */
switch (ssl_prot_method) {
- case HTSSL_V2:
- meth = SSLv2_client_method();
- break;
- case HTSSL_V3:
- meth = SSLv3_client_method();
- break;
case HTSSL_V23:
meth = SSLv23_client_method();
break;
@@ -1,40 +1,27 @@
--- ../w3c-libwww-5.4.0.orig/configure 2008-02-27 13:37:06.000000000 +0100
+++ configure 2008-02-27 13:38:26.000000000 +0100
@@ -3284,16 +3284,16 @@
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
-else
+#if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+# echo "$ac_t""yes" 1>&6
+# ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+# cat >> confdefs.h <<EOF
+##define $ac_tr_hdr 1
+#EOF
+#
+#else
echo "$ac_t""no" 1>&6
-fi
+#fi
done
--- configure.orig 2017-06-24 06:11:34 UTC
+++ configure
@@ -15439,7 +15439,7 @@ if test "x$ac_cv_func_remove" = xyes; then :

for ac_hdr in arpa/inet.h inet.h
@@ -7595,6 +7595,11 @@
else
sslinc=""
fi
+
+# sigh sigh sigh
+ssllib=$(@@PREFIX@@/bin/pkg-config --libs openssl)
+sslinc="$(@@PREFIX@@/bin/pkg-config --cflags openssl) -I@@PREFIX@@/include/openssl"
+
WWWSSL=""
SSLINC=""
LIBSSL=""

- if test "$ac_cv_func_remove" == yes ; then
+ if test "$ac_cv_func_remove" = yes ; then

$as_echo "#define unlink remove" >>confdefs.h

@@ -16416,10 +16416,14 @@ $as_echo "no" >&6; }
if test "x$withval" = "xyes"; then
withval=$ssllib
SSLINC=$sslinc
+ LIBS="$LIBS $withval"
+ else
+ SSLINC="-I$withval/include/openssl"
+ LIBS="$LIBS -L$withval/lib -lssl -lcrypto"
fi
- LIBS="$LIBS $withval"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
+#include <openssl/ssl.h>

int
main ()

0 comments on commit f0f3b77

Please sign in to comment.
You can’t perform that action at this time.