download

https://www.openssl.org/source/

config

./config --prefix=/usr/local/openssl no-shared no-threads

make&make install

make && make install

path

  export OPENSSL_CFLAGS="-I/Users/ysnows/var/openssl/include/"
  export OPENSSL_LIBS="-L/Users/ysnows/var/openssl/lib"

  or 

  export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"
  export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig"

or

ln -s /usr/local/openssl/include/openssl /usr/local/include