@ -1,7 +1,9 @@
using System ;
using System ;
using System.Net ;
using System.Net ;
using NzbDrone.Common.EnvironmentInfo ;
using NzbDrone.Common.Extensions ;
using NzbDrone.Common.Extensions ;
using NzbDrone.Common.Http.Proxy ;
using NzbDrone.Common.Http.Proxy ;
using NzbDrone.Common.Security ;
namespace NzbDrone.Common.Http.Dispatchers
namespace NzbDrone.Common.Http.Dispatchers
{
{
@ -60,6 +62,11 @@ namespace NzbDrone.Common.Http.Dispatchers
}
}
catch ( WebException e )
catch ( WebException e )
{
{
if ( e . Status = = WebExceptionStatus . SecureChannelFailure & & OsInfo . IsWindows )
{
SecurityProtocolPolicy . DisableTls12 ( ) ;
}
httpWebResponse = ( HttpWebResponse ) e . Response ;
httpWebResponse = ( HttpWebResponse ) e . Response ;
if ( httpWebResponse = = null )
if ( httpWebResponse = = null )
@ -89,7 +96,7 @@ namespace NzbDrone.Common.Http.Dispatchers
webRequest . Proxy = _createManagedWebProxy . GetWebProxy ( proxySettings ) ;
webRequest . Proxy = _createManagedWebProxy . GetWebProxy ( proxySettings ) ;
}
}
}
}
protected virtual void AddRequestHeaders ( HttpWebRequest webRequest , HttpHeader headers )
protected virtual void AddRequestHeaders ( HttpWebRequest webRequest , HttpHeader headers )
{
{
foreach ( var header in headers )
foreach ( var header in headers )