OpenSSL not getting linked with homebrew on El Capitan 10.11.6 I am trying to code in C on OS X (El Capitan) and need to use OpenSSL. OS ships with version 0.9.8zh 14 Jan 2016.

I used homebrew to upgrade and install openssl (got version 1.0.2h) but am unable to link it correctly to use it. This is what is did:

brew update

brew install openssl

brew link --force openssl


which gave me error saying

Warning: Refusing to link: openssl.

My path references /usr/local/bin as the first one.

Ran this command: 
ln -s /usr/local/Cellar/openssl/1.0.2j/include/openssl /usr/local/include/openssl 

(found this solution here: Openssl with El Capitan among other places)

got no error output, so I assumed this worked. But..

which openssl gives me this output: /usr/local/bin/openssl

openssl version gives me this output: OpenSSL 0.9.8zh 14 Jan 2016

All I'm trying to do is run some CLI commands/ write some C code edited in plain vi editor, compiled using gcc. I am including openssl in header files using

 #include &lt;openssl/sha.h&gt;
#include &lt;openssl/ripemd.h&gt;


Also, the command I am running on CLI which led me to this path was this (if that helps):

openssl dgst -sha256 -sign ec-priv.pem ex-message.txt &gt;ex-signature.der.


Gives me an error:

EVP_SignFinal:wrong public key type.


Googling led me to understand it's cause of an old OpenSSL version which I need to update. 

Any ideas on how to proceed here?
You'll need to make sure you open a new shell after performing the link. 
(I updated my medium article you linked for future reference: Openssl with El Capitan).