Fix missing certs directory in VxWorks

tst_qsslsocket checks for system CA certificates, which VxWorks doesn't have out of the box, which causes a lot of testcases to fail.
As VxWorks doesn't provide default directory structure, directory with ssl certs is provided by setting a variable.

 Task-number: QTBUG-115777

Change-Id: I5c93933ee5fbcafd6ffd76b574d8793fe75dbdbc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
bb10
Marcin Zdunek 2024-01-09 12:41:31 +01:00
parent d0d5794a3d
commit 5346404da6
1 changed files with 14 additions and 1 deletions

View File

@ -364,6 +364,12 @@ QT_BEGIN_NAMESPACE
using namespace Qt::StringLiterals;
#ifdef Q_OS_VXWORKS
constexpr auto isVxworks = true;
#else
constexpr auto isVxworks = false;
#endif
class QSslSocketGlobalData
{
public:
@ -2959,7 +2965,14 @@ QList<QByteArray> QSslSocketPrivate::unixRootCertDirectories()
ba("/opt/openssl/certs/"), // HP-UX
ba("/etc/ssl/"), // OpenBSD
};
return QList<QByteArray>::fromReadOnlyData(dirs);
QList<QByteArray> result = QList<QByteArray>::fromReadOnlyData(dirs);
if constexpr (isVxworks) {
static QString vxworksCertsDir = qgetenv("VXWORKS_CERTS_DIR");
if (!vxworksCertsDir.isEmpty()) {
result.push_back(vxworksCertsDir.toLatin1());
}
}
return result;
}
/*!