Reputation: 11
I am trying to install wget on my mac with brew however I keep on getting the following error: abmacnb01:wget-1.13 abse08$ brew install openssl
==> make depend
==> make
==> make test
Last 15 lines from /Users/abse08/Library/Logs/Homebrew/openssl/04.make:
error 20 at 0 depth lookup:unable to get local issuer certificate
../certs/demo/dsa-ca.pem: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = CA
error 20 at 0 depth lookup:unable to get local issuer certificate
../certs/demo/dsa-pca.pem: C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = PCA
error 18 at 0 depth lookup:self signed certificate
C = AU, ST = Some-State, O = Internet Widgits Pty Ltd, CN = PCA
error 10 at 0 depth lookup:certificate has expired
OK
../certs/demo/pca-cert.pem: C = AU, ST = Queensland, O = CryptSoft Pty Ltd, CN= Test PCA (1024 bit)
error 18 at 0 depth lookup:self signed certificate
C = AU, ST = Queensland, O = CryptSoft Pty Ltd, CN = Test PCA (1024 bit)
error 10 at 0 depth lookup:certificate has expired
OK
make[1]: *** [test_verify] Error 2
make: *** [tests] Error 2
READ THIS: https://git.io/brew-troubleshooting
These open issues may also help:
Erlang linked to wrong OpenSSL on OSX 10.6.8 https://github.com/Homebrew/homebrew/issues/47681
openssl: add 'enable-ssl-trace' option https://github.com/Homebrew/homebrew/pull/45250
abmacnb01:wget-1.13 abse08$
Also If i look in /System/Library/OpenSSL it exists and if i run openssl version -a I get:
OpenSSL 0.9.8zg 14 July 2015
built on: Jul 31 2015
platform: darwin64-x86_64-llvm
options: bn(64,64) md2(int) rc4(ptr,char) des(idx,cisc,16,int) blowfish(idx)
compiler: -arch x86_64 -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings - fasm-blocks -O3 -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DL_ENDIAN -DMD32_REG_T=int - DOPENSSL_NO_IDEA -DOPENSSL_PIC -DOPENSSL_THREADS -DZLIB -mmacosx-version-min=10.6
OPENSSLDIR: "/System/Library/OpenSSL"
abmacnb01:wget-1.13 abse08$
OpenSSL seems to be a dependant for nearly package I wish to use, is there a simple way to solve this?
Upvotes: 1
Views: 1871
Reputation: 368
Before starting to install it make sure you have the right folders. The goal is to compile and install in the /usr/local
. Make sure to if verify this folder already exists, don't panic if it does not. On El Cap it does not exist.
Let's change that by entering the following commands into terminal. The following commands just create the required folders:
sudo mkdir -p /usr/local/src
sudo mkdir -p /usr/local/var/log
mkdir -p ~/Library/LaunchAgents
With El Cap the folks at apple introduced a new feature called System Integrity Protection, which is just a fancy way of saying it abstracts the system code a bit further build a tighter system, its cool I guess. But this means you need to modify the ownership of the /usr/local
in order to install openSSL.
sudo chown -R $LOGNAME:staff /usr/local
sudo chown $LOGNAME:staff /usr/local
Now you have created the necessary folders Folder Structure for the installation.
Step 1: Get OpenSSL
cd /usr/local/src
curl --remote-name https://www.openssl.org/source/openssl-1.0.2h.tar.gz
Now we extract the files we just downloaded in the /usr/local/src
folder and change directory to openssl-1.0.2h:
tar -xzvf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h
Step 2: Compile & Install
Now your powers as a sorcerer of computing have summoned and extracted the soul of OpenSSL onto your Metal Machine, now you must conjure (compile) and invoke (install) this ancient beast using the following spell (lines of code):
./configure darwin64-x86_64-cc --prefix=/usr/local/openssl-1.0.2h shared
make depend
make
make install
Step 3: Update Bash
The OpenSSL Deamon has awoken and now you must cast the spell of controlling it otherwise your metal machine will be confused. The following commands update your Bash Startup Script:
echo 'export PATH=/usr/local/openssl/bin:$PATH' >> ~/.bash_profile
echo 'export MANPATH=/usr/local/openssl/ssl/man:$MANPATH' >> ~/.bash_profile
source ~/.bash_profile
Step 4: Install Certificates
It turns out even vicious demons like the one you just summoned require certificates in this paper world. So cast the following spells to give it the right certificates to work with the world:
security find-certificate -a -p /Library/Keychains/System.keychain > /usr/local/openssl/ssl/cert.pem
and the one below
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> /usr/local/openssl/ssl/cert.pem
Step 5: Verify Installation
Life is weird sometimes things don't always work the way despite our best intentions. Check if things worked:
openssl version -a
Thanks for reading, I hoped it helped! I struggled with this for a while too. Please feel free to hate/love on my attempt to add some color to the description of the solution. Also please tell me if this does not work for you, I'm curious to know. Thanks :)
Upvotes: 2
Reputation: 895
changing permissions helped me to solve this problem:
sudo chmod -R g+w /usr/local
Upvotes: 0