From d782fc224c53cbba9c47ad4fa6270750ea7175b6 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 5 Aug 2013 16:20:25 +0000 Subject: [PATCH] merged SSL fix from RC_0_16 --- ChangeLog | 1 + src/session_impl.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ea91d73f8..b900d6212 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,7 @@ * fix uTP edge case where udp socket buffer fills up * fix nagle implementation in uTP + * fix SSL authentication issue * deprecate std::wstring overloads. long live utf-8 * improve time-critical pieces feature (streaming) * introduce bandwidth exhaustion attack-mitigation in allowed-fast pieces diff --git a/src/session_impl.cpp b/src/session_impl.cpp index 0a36dff2c..56f40dd7f 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -588,7 +588,10 @@ namespace aux { if (!t->ssl_ctx()) return SSL_TLSEXT_ERR_ALERT_FATAL; // use this torrent's certificate - SSL_set_SSL_CTX(s, t->ssl_ctx()->native_handle()); + SSL_CTX *torrent_context = t->ssl_ctx()->native_handle(); + + SSL_set_SSL_CTX(s, torrent_context); + SSL_set_verify(s, SSL_CTX_get_verify_mode(torrent_context), SSL_CTX_get_verify_callback(torrent_context)); return SSL_TLSEXT_ERR_OK; }