diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/AddIn/AddIn.cs | 6 | ||||
-rw-r--r-- | src/RhSolutions-AddIn.dna | 2 | ||||
-rw-r--r-- | src/Services/RhDatabaseClient.cs | 5 |
3 files changed, 8 insertions, 5 deletions
diff --git a/src/AddIn/AddIn.cs b/src/AddIn/AddIn.cs index b747264..2aa71c7 100644 --- a/src/AddIn/AddIn.cs +++ b/src/AddIn/AddIn.cs @@ -2,6 +2,7 @@ using ExcelDna.IntelliSense; using Microsoft.Office.Interop.Excel; using RhSolutions.Services; +using System.Net; using System.Net.Http; namespace RhSolutions.AddIn @@ -18,6 +19,11 @@ namespace RhSolutions.AddIn IntelliSenseServer.Install(); RegistryUtil.Initialize(); EventsUtil.Initialize(); + + ServicePointManager.SecurityProtocol = + SecurityProtocolType.Tls12 | + SecurityProtocolType.Tls11 | + SecurityProtocolType.Tls; } public void AutoClose() diff --git a/src/RhSolutions-AddIn.dna b/src/RhSolutions-AddIn.dna index eecb271..a75d6e1 100644 --- a/src/RhSolutions-AddIn.dna +++ b/src/RhSolutions-AddIn.dna @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <DnaLibrary Name="RhSolutions Add-In" RuntimeVersion="v4.0" xmlns="http://schemas.excel-dna.net/addin/2020/07/dnalibrary"> <ExternalLibrary Path="RhSolutions.AddIn.dll" ExplicitExports="false" LoadFromBytes="true" Pack="true" IncludePdb="false" /> + <Reference Path="ExcelDna.IntelliSense.dll" Pack="true" /> + <Reference Path="Newtonsoft.Json.dll" Pack="true" /> <!-- The RuntimeVersion attribute above allows only the following setting: diff --git a/src/Services/RhDatabaseClient.cs b/src/Services/RhDatabaseClient.cs index d71a6ba..73bce3d 100644 --- a/src/Services/RhDatabaseClient.cs +++ b/src/Services/RhDatabaseClient.cs @@ -16,11 +16,6 @@ namespace RhSolutions.Services { string request = @"https://rh.cebotari.ru/api/search?query=" + line; - ServicePointManager.SecurityProtocol = - SecurityProtocolType.Tls12 | - SecurityProtocolType.Tls11 | - SecurityProtocolType.Tls; - string response = await httpClient.GetStringAsync(request); var products = JsonConvert.DeserializeObject<IEnumerable<DbProduct>>(response); |