--- pkgsrc-2015Q4/www/curl/Makefile	2015-12-06 12:31:13.000000000 +0100
+++ pkgsrc/www/curl/Makefile	2016-01-26 15:53:36.714455973 +0100
@@ -21,7 +21,6 @@
 USE_LIBTOOL=		yes
 GNU_CONFIGURE=		yes
 CONFIGURE_ARGS+=	--with-ssl=${BUILDLINK_PREFIX.openssl}
-CONFIGURE_ARGS+=	--with-ca-path=${SSLCERTS}
 CONFIGURE_ARGS+=	--with-zlib=${BUILDLINK_PREFIX.zlib}
 PKGCONFIG_OVERRIDE=	libcurl.pc.in
 
@@ -48,3 +47,11 @@
 .include "../../devel/zlib/buildlink3.mk"
 .include "../../security/openssl/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
+
+# Openssl builtin detection sets SSLCERTBUNDLE if a bundle is found
+# in /etc/. This is essential to have working curl!
+.if !empty(SSLCERTBUNDLE)
+CONFIGURE_ARGS+=        --with-ca-bundle=${SSLCERTBUNDLE}
+.else
+CONFIGURE_ARGS+=	--with-ca-path=${SSLCERTS}
+.endif
