diff options
author | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-04-26 16:59:10 +0200 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2016-05-02 15:37:38 +0000 |
commit | 9f416fad366f24436204a67b6571024d7bebe98f (patch) | |
tree | af37bee944c37dea9e9d51cbc342a1a31100be83 /src/network/ssl/qsslcontext_openssl.cpp | |
parent | ea97a43175bde48c6cbaf643988b286099c1667b (diff) |
qsslsocket/context_openssl - ALPN and NPN, not ALPN or NPN
ALPN and NPN should not be mutually exclusive, it's possible that our
peer does not support ALPN but does support a protocol we can negotiate
via NPN. So use them both.
Change-Id: Ib3c8066d89117efab55ac8435cc2c806c7a1ece0
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/ssl/qsslcontext_openssl.cpp')
-rw-r--r-- | src/network/ssl/qsslcontext_openssl.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/network/ssl/qsslcontext_openssl.cpp b/src/network/ssl/qsslcontext_openssl.cpp index 543e87c0ca..b24fdad1f9 100644 --- a/src/network/ssl/qsslcontext_openssl.cpp +++ b/src/network/ssl/qsslcontext_openssl.cpp @@ -470,12 +470,11 @@ SSL* QSslContext::createSsl() q_SSL_CTX_set_alpn_select_cb(ctx, alpn_callback_t(next_proto_cb), &m_npnContext); // Client: q_SSL_set_alpn_protos(ssl, m_npnContext.data, m_npnContext.len); - } else { -#else - { -#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ... - q_SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &m_npnContext); } +#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L ... + + // And in case our peer does not support ALPN, but supports NPN: + q_SSL_CTX_set_next_proto_select_cb(ctx, next_proto_cb, &m_npnContext); } #endif // OPENSSL_VERSION_NUMBER >= 0x1000100fL ... |