Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out the path for OpenSSL trusted certificates?

Tags:

How can I find out where my OpenSSL installation is looking for installed (trusted) certificates?

It is sometimes /etc/ssl/cert, but I have a new system and it is not working with this path.

like image 405
chris01 Avatar asked Nov 09 '10 20:11

chris01


People also ask

How do I find the certificate file path?

Under file:\\%APPDATA%\Microsoft\SystemCertificates\My\Certificates you will find all your personal certificates. Looking at the picture above and all the info I've seen over the internet, those should be stored in the registry.

Where are OpenSSL certificates stored Linux?

The default location to install certificates is /etc/ssl/certs .


2 Answers

The default path where certificates are looked up might be different on each platform. You can lookup your system configuration using the following command:

$ openssl version -d

OPENSSLDIR: "/etc/pki/tls"
like image 116
Thorsten Scherf Avatar answered Oct 06 '22 23:10

Thorsten Scherf


This C snippet, compiled against OpenSSL, will tell you:

#include <stdlib.h>
#include <stdio.h>
#include <openssl/x509.h>

int main()
{
    const char *dir;

    dir = getenv(X509_get_default_cert_dir_env());

    if (!dir)
        dir = X509_get_default_cert_dir();

    puts(dir);

    return 0;
}
like image 27
caf Avatar answered Oct 06 '22 23:10

caf