summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2017-02-01 13:55:32 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2017-04-04 10:44:29 +0000
commit5377f4ec0e82dbfbd0d148ed3affc0c7b2a3cade (patch)
treec6f0201bce3b9b0bde854772bc778fbb6befa9e8 /src/network/ssl/qsslsocket.cpp
parentde4aeade5ed86b008e6d497563cfcce9583b0c59 (diff)
Allow Secure Transport backend to use a temporary keychain
Cherry picked: this change was first merged into dev, but now we also need it in 5.9 to enable SSL socket tests on the new CI VMs (macOS 10.11, 10.12). As we do not merge dev->5.9, we need this cherry-pick. Since day one Secure Transport socket has two annoying problems on macOS: when we call SecPKCS12Import, we indeed import certs and keys into the default keychain and also (which is more serious) later a dialog can pop up, asking for permission to use a private key (this is especially annoying if you're running SSL autotests or have a server application). Apparently, it's possible to work around those problems if we create our own (temporary) keychain and pass it in the 'options' parameter to SecPKCS12Import. [ChangeLog][QtNetwork] Allow QSslSocket to use a temporary keychain on macOS. Task-number: QTBUG-56102 Change-Id: Ic3a56c905100dc80d907a25fe6ebfa232dcf5b9e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 17927392cf1cecb20cef7cb9cd77131391de087c) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/network/ssl/qsslsocket.cpp')
-rw-r--r--src/network/ssl/qsslsocket.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp
index e655f4becd..84b8f3a8d9 100644
--- a/src/network/ssl/qsslsocket.cpp
+++ b/src/network/ssl/qsslsocket.cpp
@@ -972,6 +972,13 @@ QList<QSslCertificate> QSslSocket::localCertificateChain() const
sockets, but are also rarely used by client sockets if the server requires
the client to authenticate.
+ \note Secure Transport SSL backend on macOS may update the default keychain
+ (the default is probably your login keychain) by importing your local certificates
+ and keys. This can also result in system dialogs showing up and asking for
+ permission when your application is using these private keys. If such behavior
+ is undesired, set the QT_SSL_USE_TEMPORARY_KEYCHAIN environment variable to a
+ non-zero value; this will prompt QSslSocket to use its own temporary keychain.
+
\sa localCertificate(), setPrivateKey()
*/
void QSslSocket::setLocalCertificate(const QSslCertificate &certificate)