Skip to content

Instantly share code, notes, and snippets.

@byronmansfield
Last active December 15, 2023 05:51
Show Gist options
  • Save byronmansfield/97d74d8b0d1ea28b48536020dbd6d53e to your computer and use it in GitHub Desktop.
Save byronmansfield/97d74d8b0d1ea28b48536020dbd6d53e to your computer and use it in GitHub Desktop.
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 https://www.openssl.org/source/openssl-1.1.1d.tar.gz
# 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
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
@JuHey
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/process_docs.pl
"--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?

@JuHey
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.

@sivadivi14
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

@hippietrail
Copy link

This didn't work for me on Ventura 13.1 / M1 MacBook Air:

../test/recipes/15-test_ec.t ....................... Dubious, test returned 1 (wstat 256, 0x100)
../test/recipes/80-test_cms.t ...................... Dubious, test returned 5 (wstat 1280, 0x500)
../test/recipes/80-test_ssl_new.t .................. Dubious, test returned 1 (wstat 256, 0x100)
Test Summary Report
-------------------
../test/recipes/15-test_ec.t                     (Wstat: 256 Tests: 5 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
../test/recipes/80-test_cms.t                    (Wstat: 1280 Tests: 6 Failed: 5)
  Failed tests:  1-5
  Non-zero exit status: 5
../test/recipes/80-test_ssl_new.t                (Wstat: 256 Tests: 29 Failed: 1)
  Failed test:  12
  Non-zero exit status: 1
Files=155, Tests=1450, 154 wallclock secs ( 0.70 usr  0.27 sys + 53.36 cusr 20.21 csys = 74.54 CPU)
Result: FAIL
make[1]: *** [_tests] Error 1
make: *** [tests] Error 2

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