mirror of
https://github.com/moparisthebest/curl
synced 2024-11-12 04:25:08 -05:00
added aditional check for the directory specified with SSL_DIR, and fall back to hardcoded directory if not a valid directory.
This commit is contained in:
parent
61ea058d9f
commit
4002714825
19
lib/nss.c
19
lib/nss.c
@ -964,14 +964,21 @@ CURLcode Curl_nss_connect(struct connectdata *conn, int sockindex)
|
|||||||
/* FIXME. NSS doesn't support multiple databases open at the same time. */
|
/* FIXME. NSS doesn't support multiple databases open at the same time. */
|
||||||
PR_Lock(nss_initlock);
|
PR_Lock(nss_initlock);
|
||||||
if(!initialized) {
|
if(!initialized) {
|
||||||
|
|
||||||
certDir = getenv("SSL_DIR"); /* Look in $SSL_DIR */
|
|
||||||
|
|
||||||
if(!certDir) {
|
|
||||||
struct_stat st;
|
struct_stat st;
|
||||||
|
|
||||||
if(stat(SSL_DIR, &st) == 0)
|
/* First we check if $SSL_DIR points to a valid dir */
|
||||||
if(S_ISDIR(st.st_mode)) {
|
certDir = getenv("SSL_DIR");
|
||||||
|
if(certDir) {
|
||||||
|
if((stat(certDir, &st) != 0) ||
|
||||||
|
(!S_ISDIR(st.st_mode))) {
|
||||||
|
certDir = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Now we check if the default location is a valid dir */
|
||||||
|
if(!certDir) {
|
||||||
|
if((stat(SSL_DIR, &st) == 0) &&
|
||||||
|
(S_ISDIR(st.st_mode))) {
|
||||||
certDir = (char *)SSL_DIR;
|
certDir = (char *)SSL_DIR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user