Skip to content

Commit

Permalink
Security protocol for web request set to TLS 1.2
Browse files Browse the repository at this point in the history
Fixes #5
  • Loading branch information
mbeer committed Apr 22, 2021
1 parent 31369a5 commit 5decaa5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions OutlookSwissPTTimetable/OutlookSwissPTTimetable.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<PublishUrl>ftp://127.0.0.1:21215/</PublishUrl>
<InstallUrl>https://timetable.mbeer.ch/</InstallUrl>
<TargetCulture>de</TargetCulture>
<ApplicationVersion>1.0.0.16</ApplicationVersion>
<ApplicationVersion>1.0.0.17</ApplicationVersion>
<AutoIncrementApplicationRevision>true</AutoIncrementApplicationRevision>
<UpdateEnabled>true</UpdateEnabled>
<UpdateInterval>14</UpdateInterval>
Expand All @@ -52,6 +52,11 @@
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 und x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
Expand Down Expand Up @@ -285,10 +290,11 @@
<SignManifests>true</SignManifests>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>OutlookSwissPTTimetable_1_TemporaryKey.pfx</ManifestKeyFile>
<ManifestKeyFile>
</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>008E32577D27137A379046E9A3C6D6B92BA8787D</ManifestCertificateThumbprint>
<ManifestCertificateThumbprint>9B84BFD8340B7E0205571DBC188F324A5894D6AB</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
Expand All @@ -313,7 +319,7 @@
<FlavorProperties GUID="{BAA0C2D2-18E2-41B9-852F-F413020CAA33}">
<ProjectProperties HostName="Outlook" HostPackage="{29A7B9D7-A7F1-4328-8EF0-6B2D1A56B2C1}" OfficeVersion="15.0" VstxVersion="4.0" ApplicationType="Outlook" Language="cs" TemplatesPath="" DebugInfoExeName="#Software\Microsoft\Office\16.0\Outlook\InstallRoot\Path#outlook.exe" AddItemTemplatesGuid="{A58A78EB-1C92-4DDD-80CF-E8BD872ABFC4}" />
<Host Name="Outlook" GeneratedCodeNamespace="OutlookSwissPTTimetable" PublishedHash="69C324AB27932AA2FBF2B7EA72250886FF164DE6" IconIndex="0">
<HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" PublishedHash="B5E8AE80E60EC6623871E4F37CEE7915B65BEEA6" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
<HostItem Name="ThisAddIn" Code="ThisAddIn.cs" CanonicalName="AddIn" PublishedHash="CD0DE6C1BD80E9A3CDB76E951E89EACB9303B767" CanActivate="false" IconIndex="1" Blueprint="ThisAddIn.Designer.xml" GeneratedCode="ThisAddIn.Designer.cs" />
</Host>
</FlavorProperties>
</VisualStudio>
Expand Down
2 changes: 1 addition & 1 deletion OutlookSwissPTTimetable/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("")]

Expand Down
2 changes: 1 addition & 1 deletion OutlookSwissPTTimetable/TransportOpendataCH.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Newtonsoft.Json;
using static System.Net.WebRequestMethods;

namespace TransportOpendataCH
{
Expand Down Expand Up @@ -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";
Expand Down

0 comments on commit 5decaa5

Please sign in to comment.