Open natig0ng0 opened 1 year ago
@nathan1001 example
static build openssl v1
./config -static --static no-shared --prefix=/usr/openssl --libdir=/usr/openssl/lib
socat depend readline libiconv openssl ;
libiconv
./configure --prefix=/usr/libiconv enable_static=yes enable_shared=no
readline
./configure \
--prefix=/usr/readline \
--enable-static \
--disable-shared
build static socat
PACKAGES='openssl readline'
CPPFLAGS="$(pkg-config --cflags-only-I --static $PACKAGES)" \
LDFLAGS="$(pkg-config --libs-only-L --static $PACKAGES)" \
LIBS="$(pkg-config --libs-only-l --static $PACKAGES)" \
CFLAGS="-static -O2 -Wall -fPIC -DWITH_OPENSSL" \
./configure \
--prefix=/usr/socat \
--enable-readline \
--enable-openssl-base=/usr/openssl
test and verify
wget https://curl.se/ca/cacert.pem
./socat -d -d TCP4-LISTEN:8016,reuseaddr,fork ssl:example.com:443,verify=1,\
snihost=example.com,commonname=example.com,\
openssl-min-proto-version=TLS1.3,openssl-max-proto-version=TLS1.3,cafile=/root/cacert.pem
reference:
more info: https://github.com/aledbf/socat-static-binary/blob/master/build.sh https://github.com/andrew-d/static-binaries/blob/master/socat/build.sh
Sorry to hijack this Issue, but I have been working on a successor project: https://github.com/Azathothas/Toolpacks
There's already over 2000+
precompiled binaries available to download, including socat
:
!#aarch64 Linux
#https://github.com/Azathothas/Toolpacks/tree/main/.github/scripts/aarch64_Linux/bins/socat.sh
https://bin.ajam.dev/aarch64_arm64_Linux/socat
!#x86_64 Linux
#https://github.com/Azathothas/Toolpacks/blob/main/.github/scripts/x86_64_Linux/bins/socat.sh
https://bin.ajam.dev/x86_64_Linux/socat
I am currently facing an issue trying to build the socat static binaries. Please find below the issue.
openssl-1.1.0f/e_os.h