Where does Brew install OpenSSL on OS X?

Hi Everyone,

Please forgive my ignorance. Search is producing irrelevant noise for the question…

We are trying to enable OS X builds using Travis for Unbound. The OS X test is failing due to OpenSSL. We added the following to the YML file, but Brew states OpenSSL is already installed.

before_install:
  - |
    if [ "$TRAVIS_OS_NAME" = "osx" ]; then
        brew update
        brew install openssl
    fi

The actual configure failure is:

checking for SSL... configure: error: Cannot find the SSL libraries in /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr

Where does Brew install OpenSSL on OS X?

Brew should install OpenSSL in the following directory:

/usr/local/opt/openssl/bin/openssl

-Montana (Travis CI Staff)

2 Likes
$ brew info openssl   
<...>
openssl@1.1 is keg-only, which means it was not symlinked into /usr/local,
because openssl/libressl is provided by macOS so don't link an incompatible version.

If you need to have openssl@1.1 first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@1.1 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
1 Like

Thanks Montana, was actually going to ask this next, found it perfectly!

1 Like

No problem @TheDFury!

-Montana (Travis CI Staff)

@noloader Note that linking to a nonversioned path will break your app in Homebrew environments where the default version is different.

This did happen recently when Homebrew migrated from 1.0.x to 1.1.x.

1 Like

Thanks everyone. I appreciate the help.