summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2019-08-01 15:01:27 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2019-08-01 17:37:53 +0200
commitec62033bc25ed60a6bb9286d07e4f4485800b068 (patch)
tree7d3d05d93839515d67ede8c0f822d2c65c6e4834 /tests
parent662798d785c309a343c13648cb018c7f556757a9 (diff)
tst_http2::connectToHost - add a fix for SecureTransport backend
One of the tests above was unsetting a variable that enforces the use of a temporary keychain. We have to set it back, otherwise the test is failing. What surprises me though - why I had this problem only locally and not on CI? Apparently, SecureTransport is not covered by our configurations ... Change-Id: I0ff1e3e304632869391ed61213c245b949d8c778 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/network/access/http2/tst_http2.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp
index ce685a1b1c..10dad25337 100644
--- a/tests/auto/network/access/http2/tst_http2.cpp
+++ b/tests/auto/network/access/http2/tst_http2.cpp
@@ -591,6 +591,19 @@ void tst_Http2::connectToHost()
#if QT_CONFIG(ssl)
Q_ASSERT(!clearTextHTTP2 || connectionType != H2Type::h2Alpn);
+
+#if QT_CONFIG(securetransport)
+ // Normally on macOS we use plain text only for SecureTransport
+ // does not support ALPN on the server side. With 'direct encrytped'
+ // we have to use TLS sockets (== private key) and thus suppress a
+ // keychain UI asking for permission to use a private key.
+ // Our CI has this, but somebody testing locally - will have a problem.
+ qputenv("QT_SSL_USE_TEMPORARY_KEYCHAIN", QByteArray("1"));
+ auto envRollback = qScopeGuard([](){
+ qunsetenv("QT_SSL_USE_TEMPORARY_KEYCHAIN");
+ });
+#endif // QT_CONFIG(securetransport)
+
#else
Q_ASSERT(connectionType == H2Type::h2c || connectionType == H2Type::h2cDirect);
Q_ASSERT(targetServer->isClearText());