diff options
author | Ahmad Samir <[email protected]> | 2025-04-30 17:30:42 +0300 |
---|---|---|
committer | Ahmad Samir <[email protected]> | 2025-05-14 04:41:13 +0300 |
commit | 2be51c692307f067bb5bdc011e5f3dca1dbe3ff8 (patch) | |
tree | 81367961331585b4ad02dd8773b467af929d67e5 /src/plugins/tls/openssl/qtlsbackend_openssl.cpp | |
parent | 2875c4358beedd0997b60d21df4b95dbfec4f9a6 (diff) |
QSslCertificate: add fromFile() method
QSslCertificate::fromPath() does some extra work:
- matching wildcard glob or regular expression patterns
- checks if the string it's called on is a file or a dir
That extra work isn't needed when you already have the path to a
specific certificate file.
E.g. qtlsbackend_openssl.cpp:systemCaCertificates() used to call
fromPath() on *.pem/*.crt files that it got from iterating over system
certifcates dirs.
This also de-duplicates the code in fromPath().
[ChangeLog][QtNetwork][QSslCertificate] Added fromFile() method.
Change-Id: I92ab358e4711866dd4510da42c47905c7dae58b1
Reviewed-by: Ivan Solovev <[email protected]>
Reviewed-by: MÃ¥rten Nordheim <[email protected]>
Diffstat (limited to 'src/plugins/tls/openssl/qtlsbackend_openssl.cpp')
-rw-r--r-- | src/plugins/tls/openssl/qtlsbackend_openssl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp index 6a55f275943..bce31734f94 100644 --- a/src/plugins/tls/openssl/qtlsbackend_openssl.cpp +++ b/src/plugins/tls/openssl/qtlsbackend_openssl.cpp @@ -410,7 +410,7 @@ QList<QSslCertificate> systemCaCertificates() } } for (const QString& file : std::as_const(certFiles)) - systemCerts.append(QSslCertificate::fromPath(file, QSsl::Pem)); + systemCerts.append(QSslCertificate::fromFile(file, QSsl::Pem)); } #endif // platform #ifdef QSSLSOCKET_DEBUG |