SSL Fix by default, Added support of TLS 1.1 & 1.2 (#337)

* SSL Fix by default, Now use TLS (1.2, 1.1, 1) by default
* Workaround to use TLS 1.2 & 1.1 on Mono < 4.3
This commit is contained in:
JigSaw
2016-05-14 00:46:56 +02:00
parent b29c578adb
commit 28199ab4be
4 changed files with 197 additions and 175 deletions

View File

@@ -69,6 +69,13 @@ namespace Jackett.Utils.Clients
proxyServer = new WebProxy(Startup.ProxyConnection, false);
useProxy = true;
}
// SecurityProtocolType values below not available in Mono < 4.3
const int SecurityProtocolTypeTls11 = 768;
const int SecurityProtocolTypeTls12 = 3072;
// Specify to use TLS 1.2 as default connection
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)(SecurityProtocolTypeTls12 | SecurityProtocolTypeTls11);
var client = new HttpClient(new HttpClientHandler
{
CookieContainer = cookies,