0

I am trying to code in C on mac (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. Am facing the same issue as mentioned in this question: Homebrew refusing to link OpenSSL

It seems answers to the above question are not valid anymore coz of some update in brew.

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: https://medium.com/@zlwaterfield/openssl-with-el-capitan-456bf68bf43a#.f9tkjeo7w 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

Any ideas on how to proceed?

@jww am not sure what you mean by "build your stuff". I am not a programmer and hence do not really fully understand vocabulary. Just trying to learn some stuff.

I ran

brew update

brew install openssl

brew link --force openssl

which gave me error saying

Warning: Refusing to link: openssl.

I didnt write this for sake of brevity and instead I provided link to question which showed exactly the problem I was facing. Coz earlier I have been told I have not been brief enough in forming que.

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 >ex-signature.der.

Gives me an error:

EVP_SignFinal:wrong public key type.

Googling led me to understand its coz of an old openssl version which I need to update. Does this answer your question?

Community
  • 1
  • 1
Tuhina Singh
  • 927
  • 2
  • 10
  • 19
  • State where the OpenSSL you want to use is located. Show how you configured your project if its Autoconf based. Show your compiler and linker commands. Also see [Brew refusing to link openssl](http://stackoverflow.com/q/38670295), [Update OpenSSL on OS X with Homebrew](http://stackoverflow.com/q/15185661), [How to install latest version of openssl Mac OS X El Capitan](http://stackoverflow.com/q/35129977), [How to upgrade OpenSSL in OS X?](http://apple.stackexchange.com/q/126830), [Openssl installation using HomeBrew fails](http://superuser.com/q/486389), etc. – jww Oct 03 '16 at 04:17
  • Thanks @jww: have already seen those questions. Where is openssl located: `/usr/local/Cellar/openssl/1.0.2j`. No project as such. Just dabbling with plain C code edited with `vi`, compiled using `gcc`, testing using `CLI` commands. – Tuhina Singh Oct 03 '16 at 04:47
  • Thanks @Tuhina. I voted to close because you won't provide the commands you are using to build your stuff. If all you seek is how to put `openssl` on-path, then you should ask on an appropriate site, like [Super User](http://superuser.com/) or [Apple Stack Exchange](http://apple.stackexchange.com/). – jww Oct 03 '16 at 05:23

1 Answers1

2

So the issue of linking openssl was resolved like this: I only had to close the old shell window and running the new shell window to run command openssl version and it showed me the correct new version. Basically the explicit linking worked with the command that i stated in the question.

Tuhina Singh
  • 927
  • 2
  • 10
  • 19
  • That was the same case for me. Very odd. I was getting the error `Warning: Refusing to link macOS provided/shadowed software: openssl@1.1`, but when closing and re-opening the terminal on Mac, `openssl version` gave me the output I was hoping to see of `OpenSSL 1.1.1j` – King Holly Feb 23 '21 at 20:32