Skip to content

Instantly share code, notes, and snippets.

Last active October 4, 2023 11:13
  • Star 13 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Install OpenSSL from source Mac OS X
# Install OpenSSL from source on Mac OS X
# prepare workspace
mkdir -p ~/code/build-from-src/ && cd $_
# download source code
curl -LO
# expand tar
tar -xzvf openssl-1.1.1d.tar.gz
cd openssl-1.1.1d
# configure, make, install
perl ./Configure --prefix=/usr/local --openssldir=/usr/local/openssl no-ssl3 no-ssl3-method no-zlib darwin64-x86_64-cc enable-ec_nistp_64_gcc_128
make test
sudo make install MANDIR=/usr/share/man MANSUFFIX=ssl
# verify
openssl version
which -a openssl
# clean up
make clean
make distclean
cd ..
rm -fr openssl-1.1.1d
rm openssl-1.1.1d.tar.gz
Copy link

JuHey commented Sep 9, 2022

Thank you for putting the code onto Github! I tried to reproduce the install from source on Mac OSX (Monterey, 12.5.1) and ran into an issue at line 17, sudo make install. I get the following error message:

*** Installing manpages
perl ./util/
"--destdir=/usr/share/man" --type=man --suffix=ssl
Trying to write to /usr/share/man/man1/asn1parse.1ssl: Operation not permitted
make: *** [install_man_docs] Error 1

Would you happen to have a suggestion on how to get past this issue?

Copy link

JuHey commented Sep 9, 2022

Here is what worked for me:
sudo make install MANDIR=/usr/local/openssl/share/man MANSUFFIX=ssl
That completed fine.

Copy link

I am getting below error , need help on this.
/Library/Developer/CommandLineTools/usr/bin/make depend && /Library/Developer/CommandLineTools/usr/bin/make _build_programs
cc -Iinclude -arch x86_64 -O3 -Wall -D_REENTRANT -DNDEBUG -MMD -MF test/v3ext.d.tmp -MT test/v3ext.o -c -o test/v3ext.o test/v3ext.c
test/v3ext.c:201:24: error: implicitly declaring library function 'memcmp' with type 'int (const void *, const void *, unsigned long)' [-Werror,-Wimplicit-function-declaration]
if (!TEST_true(memcmp(ip1->data, ip2->data, ip1->length) <= 0))
test/v3ext.c:201:24: note: include the header <string.h> or explicitly provide a declaration for 'memcmp'
1 error generated.
make[1]: *** [test/v3ext.o] Error 1
make: *** [build_programs] Error 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment