HttpClient and TLS compatibility

VishalAg
Member Posts: 5
Hi,
Currently I have been trying to integrate a website with Business Central 19 saas.
The website doesn't have a SSL certificate, so I need to skip its verification when sending https GET request.
Earlier I used ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 to use TLS protocol while calling a webservices but currently I think the Business Central doesn't support the same.
Can anyone let me know a way to call 3rd party web services using TLS protocol.
Thank You.
@kriki @ftornero @RockWithNAV @DenSter @rkaufmann @ara3n @vaprog or anyone who can help
Currently I have been trying to integrate a website with Business Central 19 saas.
The website doesn't have a SSL certificate, so I need to skip its verification when sending https GET request.
Earlier I used ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 to use TLS protocol while calling a webservices but currently I think the Business Central doesn't support the same.
Can anyone let me know a way to call 3rd party web services using TLS protocol.
Thank You.
@kriki @ftornero @RockWithNAV @DenSter @rkaufmann @ara3n @vaprog or anyone who can help
0
Best Answer
Answers
-
0
-
Hi,
Maybe you can create an Azure function and write an HttpClient method as you want using the necessary .Net objects and then call it from within Business Central.
I'm very new to the world of Business Central, sorry if I misunderstood or gave any wrong information.
https://docs.microsoft.com/en-us/learn/modules/use-azure-functions/0 -
@ftornero, I am using Httpclient to make calls. In postman when I make call, I can disable the Veriy SSL and it works fine. But in saas model, I am unable to find such option which will disable the SSL verification or make the use of TLS instead of SSL.
Below is the code being used:
SalesSetup.GET;
SalesSetup.TestField("API Consumer Key");
SalesSetup.TestField("API Consumer Secret");
SalesSetup.TestField("API Default Customer");
SalesSetup.TestField("API Link (All Orders)");
AuthString := SalesSetup."API Consumer Key" + ':' + SalesSetup."API Consumer Secret";
AuthString := Base64.ToBase64(AuthString);
URL := SalesSetup."API Link (All Orders)";
HttpClient.DefaultRequestHeaders.Add('Authorization', AuthString);
HttpClient.DefaultRequestHeaders.Add('User-Agent', 'Dynamics 365');
IF NOT HttpClient.GET(URL, ResponseMessage) then
Error('The call to webservice failed.');
IF Not ResponseMessage.IsSuccessStatusCode THEN
Error('The webservice returned an error message:\\' +
'Status Code: %1\' +
'Description: %2',
ResponseMessage.HttpStatusCode, ResponseMessage.ReasonPhrase);0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions