Move Serurity protocol changer
This commit is contained in:
parent
64d0abd006
commit
a9ffc5510d
@ -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()
|
||||
|
@ -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:
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user