如何找出 OpenSSL 可信证书的路径? [英] How to find out the path for OpenSSL trusted certificates?

查看:77
本文介绍了如何找出 OpenSSL 可信证书的路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何找出我的 OpenSSL 安装在哪里寻找已安装的(受信任的)证书?

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

有时是 /etc/ssl/cert,但我有一个新系统,它不能使用此路径.

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

推荐答案

这个针对 OpenSSL 编译的 C 代码片段会告诉你:

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;
}

这篇关于如何找出 OpenSSL 可信证书的路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆