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
Answers
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/
I don't know if you can share more information about the issue, how are you doing the call to the remote website, what is the return that you got, etc.
Regards.
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);
And what response do you got ?.
In the other hand, usually for the basic authorization, like the one you are using, the value is preceding by Basic and an space, like this: