diff options
author | Renato Botelho <renato@netgate.com> | 2016-02-22 08:15:16 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-02-22 08:15:16 -0300 |
commit | f4f04f91a787d9f61d56b19a966ae4a9b9e79ad5 (patch) | |
tree | c8f562ba883b266c55aa072076176e4a77d56cea /lib/libfetch/common.c | |
parent | 0122703298a46bed8c81d6430ffe126414556b51 (diff) | |
parent | 4112d41bd632ff2eb376f20f94cfed638b0426bf (diff) | |
download | FreeBSD-src-f4f04f91a787d9f61d56b19a966ae4a9b9e79ad5.zip FreeBSD-src-f4f04f91a787d9f61d56b19a966ae4a9b9e79ad5.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'lib/libfetch/common.c')
-rw-r--r-- | lib/libfetch/common.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index ae8b79d..76dc4f9 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -705,7 +705,8 @@ fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) if (ca_cert_file == NULL && access(LOCAL_CERT_FILE, R_OK) == 0) ca_cert_file = LOCAL_CERT_FILE; - if (ca_cert_file == NULL) + if (ca_cert_file == NULL && + access(BASE_CERT_FILE, R_OK) == 0) ca_cert_file = BASE_CERT_FILE; ca_cert_path = getenv("SSL_CA_CERT_PATH"); if (verbose) { @@ -716,11 +717,17 @@ fetch_ssl_setup_peer_verification(SSL_CTX *ctx, int verbose) if (ca_cert_path != NULL) fetch_info("Using CA cert path: %s", ca_cert_path); + if (ca_cert_file == NULL && ca_cert_path == NULL) + fetch_info("Using OpenSSL default " + "CA cert file and path"); } SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, fetch_ssl_cb_verify_crt); - SSL_CTX_load_verify_locations(ctx, ca_cert_file, - ca_cert_path); + if (ca_cert_file != NULL || ca_cert_path != NULL) + SSL_CTX_load_verify_locations(ctx, ca_cert_file, + ca_cert_path); + else + SSL_CTX_set_default_verify_paths(ctx); if ((crl_file = getenv("SSL_CRL_FILE")) != NULL) { if (verbose) fetch_info("Using CRL file: %s", crl_file); |