mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-02-16 10:58:31 -05:00
Support additional security protocols and use the real version number in the user agent
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Net;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Common.Update;
|
||||||
|
|
||||||
namespace FeedCenter
|
namespace FeedCenter
|
||||||
{
|
{
|
||||||
@@ -115,6 +116,9 @@ namespace FeedCenter
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
// Add extra security protocols
|
||||||
|
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
|
||||||
|
|
||||||
// Create the web request
|
// Create the web request
|
||||||
var oRequest = WebRequest.Create(new Uri(Source));
|
var oRequest = WebRequest.Create(new Uri(Source));
|
||||||
|
|
||||||
@@ -138,7 +142,7 @@ namespace FeedCenter
|
|||||||
webRequest.Credentials = new NetworkCredential(Username, Password, Domain);
|
webRequest.Credentials = new NetworkCredential(Username, Password, Domain);
|
||||||
|
|
||||||
// Set a user agent string
|
// Set a user agent string
|
||||||
webRequest.UserAgent = "FeedCenter 1.0 ALPHA";
|
webRequest.UserAgent = "FeedCenter " + UpdateCheck.LocalVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the default encoding
|
// Set the default encoding
|
||||||
|
|||||||
Reference in New Issue
Block a user