Support additional security protocols and use the real version number in the user agent

This commit is contained in:
2017-03-02 09:22:36 -05:00
parent e13894bed2
commit 2f7a268013

View File

@@ -9,6 +9,7 @@ using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Common.Update;
namespace FeedCenter
{
@@ -115,6 +116,9 @@ namespace FeedCenter
{
try
{
// Add extra security protocols
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
// Create the web request
var oRequest = WebRequest.Create(new Uri(Source));
@@ -138,7 +142,7 @@ namespace FeedCenter
webRequest.Credentials = new NetworkCredential(Username, Password, Domain);
// Set a user agent string
webRequest.UserAgent = "FeedCenter 1.0 ALPHA";
webRequest.UserAgent = "FeedCenter " + UpdateCheck.LocalVersion;
}
// Set the default encoding