summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/tls')
-rw-r--r--src/plugins/tls/openssl/qtlsbackend_openssl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp
index deb257be01c..d3b7d669ec7 100644
--- a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp
+++ b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp
@@ -407,8 +407,13 @@ QList<QSslCertificate> systemCaCertificates()
for (const QByteArray &directory : directories) {
for (const auto &dirEntry : QDirListing(QFile::decodeName(directory), flags)) {
// use canonical path here to not load the same certificate twice if symlinked
- if (hasMatchingExtension(dirEntry.fileName()))
- certFiles.insert(dirEntry.canonicalFilePath());
+ if (hasMatchingExtension(dirEntry.fileName())) {
+ QString canonicalPath = dirEntry.canonicalFilePath();
+ // skip broken symlinks to not end up adding "" to the list which will then
+ // just be rejected by `QSslCertificate::fromFile`
+ if (!canonicalPath.isEmpty())
+ certFiles.insert(canonicalPath);
+ }
}
}
for (const QString& file : std::as_const(certFiles))