how to find out the path for openssl trusted certificate?

后端 未结 4 1227
醉梦人生
醉梦人生 2020-12-29 06:16

how can I find out, where my openssl installed is looking for installed certificates (trusted)? it is sometimes /etc/ssl/cert but I have here a new system and it is not work

4条回答
  •  粉色の甜心
    2020-12-29 07:08

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

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

提交回复
热议问题