From c3e2e1e94b227bfba9ea8b1fef1b052580f2e0d1 Mon Sep 17 00:00:00 2001 From: Michael Bemmerl Date: Tue, 31 Oct 2017 23:28:01 +0000 Subject: [PATCH] Accept all available encryption protocols available to the .NET 4.0 Framework (TLS 1.0, 1.1, 1.2; SSL 3) git-svn-id: https://svn.openstreetmap.org/applications/utils/Srtm2Osm/trunk@33758 b9d5c4c9-76e1-0310-9c85-f3177eceb1e4 --- OsmUtils.Framework/OsmUtils.Framework.csproj | 1 - Srtm2Osm/Srtm2OsmCommand.cs | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/OsmUtils.Framework/OsmUtils.Framework.csproj b/OsmUtils.Framework/OsmUtils.Framework.csproj index b73cff1..2a2140f 100644 --- a/OsmUtils.Framework/OsmUtils.Framework.csproj +++ b/OsmUtils.Framework/OsmUtils.Framework.csproj @@ -65,7 +65,6 @@ CommonAssemblyInfo.cs - diff --git a/Srtm2Osm/Srtm2OsmCommand.cs b/Srtm2Osm/Srtm2OsmCommand.cs index b3e4f59..a293948 100644 --- a/Srtm2Osm/Srtm2OsmCommand.cs +++ b/Srtm2Osm/Srtm2OsmCommand.cs @@ -14,6 +14,7 @@ using Brejc.Geometry; using System.Text.RegularExpressions; using System.Globalization; +using System.Net; namespace Srtm2Osm { @@ -49,8 +50,14 @@ public void Execute () ConsoleActivityLogger activityLogger = new ConsoleActivityLogger(); activityLogger.LogLevel = ActivityLogLevel.Verbose; + // Use all available encryption protocols supported in the .NET Framework 4.0. + // TLS versions > 1.0 are supported and available via the extensions. + // see https://blogs.perficient.com/microsoft/2016/04/tsl-1-2-and-net-support/ + // This is a global setting for all HTTP requests. + ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls | SecurityProtocolTypeExtensions.Tls11 | SecurityProtocolTypeExtensions.Tls12 | SecurityProtocolType.Ssl3; + // first make sure that the SRTM directory exists - if (false == Directory.Exists (srtmDir)) + if (!Directory.Exists (srtmDir)) Directory.CreateDirectory (srtmDir); string srtmIndexFilename = Path.Combine (srtmDir, "SrtmIndex.dat");