[Privoxy-devel] 0004-Enable-building-Privoxy-with-OpenSSL
Lee
ler762 at protonmail.com
Thu Aug 3 17:39:58 CEST 2023
Empty Message
-------------- next part --------------
From 8aad56e6175a7201e9c85e2612c059d458a5e11a Mon Sep 17 00:00:00 2001
From: Lee <ler762 at users.sourceforge.net>
Date: Sun, 30 Jul 2023 13:51:13 -0400
Subject: [PATCH 4/9] Enable building Privoxy with OpenSSL on Windows
- openssl.c
I got random crashes when using openssl on windows; fixed with
#include <openssl/applink.c>
I don't understand
https://www.openssl.org/docs/faq.html
it seems to be applicable only to calling DLLs but even with
no DLLs involved that include also fixes whatever it is with
statically linking openssl
- project.h
pull in the required gunk for windows
- windows/MYconfigure
way too many warnings in openssl.c about RSA deprecated-declarations
so add -Wno-deprecated-declarations to get rid of them.
make it easier to specify "--with-mbedtls" or "--with-openssl"
---
openssl.c | 7 +++++++
project.h | 4 ++++
windows/MYconfigure | 17 +++++++++++------
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/openssl.c b/openssl.c
index 44e21b20..10e3e527 100644
--- a/openssl.c
+++ b/openssl.c
@@ -38,6 +38,13 @@
#include <openssl/pem.h>
#include <openssl/md5.h>
#include <openssl/x509v3.h>
+#ifdef _WIN32
+/* https://www.openssl.org/docs/faq.html
+ I’ve compiled a program under Windows and it crashes: Why?
+ tl,dr: because it needs this include:
+*/
+#include <openssl/applink.c>
+#endif /* _WIN32 */
#include "config.h"
#include "project.h"
diff --git a/project.h b/project.h
index b203ad33..04fbe8e0 100644
--- a/project.h
+++ b/project.h
@@ -65,6 +65,10 @@
#ifdef FEATURE_HTTPS_INSPECTION_OPENSSL
#ifdef _WIN32
+#include <windef.h>
+#include <minwindef.h>
+#include <basetsd.h>
+#include <minwinbase.h>
#include <wincrypt.h>
#undef X509_NAME
#undef X509_EXTENSIONS
diff --git a/windows/MYconfigure b/windows/MYconfigure
index bc3d4bb6..c107008e 100755
--- a/windows/MYconfigure
+++ b/windows/MYconfigure
@@ -103,6 +103,9 @@ CFLAGS="${CFLAGS} -Wno-unused-parameter -Wno-unused-but-set-variable"
#-no-# CFLAGS="${CFLAGS} -Wconversion"
# way too many warnings for things that don't look like a problem
+CFLAGS="${CFLAGS} -Wno-deprecated-declarations"
+# way too many warnings in openssl.c about RSA deprecated-declarations
+
#-no-# CFLAGS="${CFLAGS} -Werror"
# Turn all warnings into errors.
# Privoxy still has a few warnings that are not a problem
@@ -157,12 +160,14 @@ LDFLAGS="${LDFLAGS} -L${lib}"
## which is backward-compatible and will be supported for at least
## 3 years.
# Get the 2.28.x mbedtls library from https://github.com/Mbed-TLS/mbedtls/tags
-inc="/source/mbedtls-2.28.3/include"
-lib="/source/mbedtls-2.28.3/library"
-MITMOPT="--with-mbedtls"
-CPPFLAGS="${CPPFLAGS} -I${inc}"
-LDFLAGS="${LDFLAGS} -L${lib}"
+##MITMOPT="--with-mbedtls"
+##inc="/source/mbedtls-2.28.3/include"
+##lib="/source/mbedtls-2.28.3/library"
+##CPPFLAGS="${CPPFLAGS} -I${inc}"
+##LDFLAGS="${LDFLAGS} -L${lib}"
+
+MITMOPT="--with-openssl"
# brotli
# Get the brotli library from https://github.com/google/brotli/releases
@@ -190,7 +195,7 @@ echo "LDFLAGS=${LDFLAGS}"
--enable-strptime-sanity-checks \
--disable-pthread \
--with-brotli \
- --with-mbedtls \
+ ${MITMOPT} \
--with-docbook=yes
# -- done --
--
2.39.0
More information about the Privoxy-devel
mailing list