From 5decaa5db93daba55b450ae7bd1456faecce343d Mon Sep 17 00:00:00 2001 From: Michael Beer Date: Thu, 22 Apr 2021 10:36:07 +0200 Subject: [PATCH] Security protocol for web request set to TLS 1.2 Fixes #5 --- .../OutlookSwissPTTimetable.csproj | 14 ++++++++++---- OutlookSwissPTTimetable/Properties/AssemblyInfo.cs | 2 +- OutlookSwissPTTimetable/TransportOpendataCH.cs | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/OutlookSwissPTTimetable/OutlookSwissPTTimetable.csproj b/OutlookSwissPTTimetable/OutlookSwissPTTimetable.csproj index 87f1e83..436e965 100644 --- a/OutlookSwissPTTimetable/OutlookSwissPTTimetable.csproj +++ b/OutlookSwissPTTimetable/OutlookSwissPTTimetable.csproj @@ -34,7 +34,7 @@ ftp://127.0.0.1:21215/ https://timetable.mbeer.ch/ de - 1.0.0.16 + 1.0.0.17 true true 14 @@ -52,6 +52,11 @@ Microsoft .NET Framework 4.6.1 %28x86 und x64%29 true + + False + Microsoft .NET Framework 4.8 %28x86 und x64%29 + true + False .NET Framework 3.5 SP1 @@ -285,10 +290,11 @@ true - OutlookSwissPTTimetable_1_TemporaryKey.pfx + + - 008E32577D27137A379046E9A3C6D6B92BA8787D + 9B84BFD8340B7E0205571DBC188F324A5894D6AB false @@ -313,7 +319,7 @@ - + diff --git a/OutlookSwissPTTimetable/Properties/AssemblyInfo.cs b/OutlookSwissPTTimetable/Properties/AssemblyInfo.cs index f38ea8a..ec05ef5 100644 --- a/OutlookSwissPTTimetable/Properties/AssemblyInfo.cs +++ b/OutlookSwissPTTimetable/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("OutlookSwissPTTimetable")] -[assembly: AssemblyCopyright("Copyright © 2018 Michael Beer")] +[assembly: AssemblyCopyright("Copyright © 2018–2021 Michael Beer")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/OutlookSwissPTTimetable/TransportOpendataCH.cs b/OutlookSwissPTTimetable/TransportOpendataCH.cs index e149c84..c74435e 100644 --- a/OutlookSwissPTTimetable/TransportOpendataCH.cs +++ b/OutlookSwissPTTimetable/TransportOpendataCH.cs @@ -5,7 +5,6 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using Newtonsoft.Json; -using static System.Net.WebRequestMethods; namespace TransportOpendataCH { @@ -51,6 +50,7 @@ private HttpWebRequest PrepareWebRequest() string Webstring = @"https://transport.opendata.ch/v1/connections?" + String.Join("&", parameters); Uri Webaddress = new Uri(Webstring); + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; HttpWebRequest request = WebRequest.Create(Webaddress) as HttpWebRequest; request.Method = "GET"; request.UserAgent = "Swiss public transport timetable add-in for Microsoft Outlook";