Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find the openssl.cnf file on my mac

I am trying to locate the "openssl.cnf" file on my mac, and I haven't found it in these locations:

 /usr/local/ssl/openssl.cnf
 /usr/lib/ssl/openssl.cnf
 /etc/ssl/openssl.cnf

There is no "ssl" folder to begin with...

When I type the command "openssl version" on the terminal, it gives me: OpenSSL 0.9.8za 5

so what could be the problem?

like image 795
Darknespawn Avatar asked Dec 30 '14 09:12

Darknespawn


People also ask

Where is my OpenSSL CNF file?

OpenSSL by default looks for a configuration file in /usr/lib/ssl/openssl. cnf so always add -config /etc/openssl. cnf to the commands openssl ca or openssl req for instance.

What is OpenSSL CNF file?

The openssl. cnf file is primarily used to set default values for the CA function, key sizes for generating new key pairs, and similar configuration. Consult the OpenSSL documentation available at openssl.org for more information.

Where is OpenSSL CNF in Windows?

OpenSSL for Windows has now been installed and can be found as OpenSSL.exe in C:\OpenSSL-Win32\bin\.


3 Answers

On my Yosemite El Capitan system:

$ locate openssl.cnf
/System/Library/OpenSSL/openssl.cnf

On Sierra High Sierra Mojave, I have two copies of openssl.cnf with different contents:

$ locate openssl.cnf
/System/Library/OpenSSL/openssl.cnf
/private/etc/ssl/openssl.cnf

I think /System/Library/OpenSSL/openssl.cnf is still the "official" reference. The second one was installed for some particular piece of software.

On Catalina, I have three copies:

% locate openssl.cnf
/System/Library/OpenSSL/openssl.cnf
/System/Library/Templates/Data/private/etc/ssl/openssl.cnf
/private/etc/ssl/openssl.cnf

Again, I believe /System/Library/OpenSSL/openssl.cnf is the "official" copy of the file. /private/etc/ssl/openssl.cnf is a private copy of the file for some software on the system which needs its own copy. /System/Library/Templates/Data/private/etc/ssl/openssl.cnf is a "template" which the system can use to detect changes to /private/etc/ssl/openssl.cnf.

like image 75
Kenster Avatar answered Sep 23 '22 14:09

Kenster


If you installed OpenSSL via Homebrew, it is at /usr/local/etc/openssl/openssl.cnf

like image 36
Wim Deblauwe Avatar answered Sep 23 '22 14:09

Wim Deblauwe


openssl version -a

will give folder in which openssl was compiled in a OPENSSLDIR output section

like image 29
Vlad Avatar answered Sep 27 '22 14:09

Vlad