Clarify that ca_info files must exist as files
From file_test documentation: Returns TRUE if any of the tests in the bitfield test are TRUE. A Glib::file_test parameter like Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR will thus also return true if the path exist as a directory. Make the code work as intended by simply using Glib::FILE_TEST_IS_REGULAR
This commit is contained in:
parent
d069aa7a56
commit
47b7b98652
@ -83,15 +83,15 @@ HttpGet::setup_certificate_paths ()
|
||||
*/
|
||||
assert (!ca_path && !ca_info); // call once
|
||||
|
||||
if (Glib::file_test ("/etc/pki/tls/certs/ca-bundle.crt", Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
|
||||
if (Glib::file_test ("/etc/pki/tls/certs/ca-bundle.crt", Glib::FILE_TEST_IS_REGULAR)) {
|
||||
// Fedora / RHEL, Arch
|
||||
ca_info = "/etc/pki/tls/certs/ca-bundle.crt";
|
||||
}
|
||||
else if (Glib::file_test ("/etc/ssl/certs/ca-certificates.crt", Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
|
||||
else if (Glib::file_test ("/etc/ssl/certs/ca-certificates.crt", Glib::FILE_TEST_IS_REGULAR)) {
|
||||
// Debian and derivatives
|
||||
ca_info = "/etc/ssl/certs/ca-certificates.crt";
|
||||
}
|
||||
else if (Glib::file_test ("/etc/pki/tls/cert.pem", Glib::FILE_TEST_EXISTS|Glib::FILE_TEST_IS_REGULAR)) {
|
||||
else if (Glib::file_test ("/etc/pki/tls/cert.pem", Glib::FILE_TEST_IS_REGULAR)) {
|
||||
// GNU/TLS can keep extra stuff here
|
||||
ca_info = "/etc/pki/tls/cert.pem";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user