I am creating a VB.net application which is required to use some data retrieved from an API, via a POST request. Said POST request appears to be working fine on my end (a Windows 10 machine), both via the Insomnia REST client app and my own application. However, on a client's machine (using Windows Server 2012 R2), the same request, while executing as usual when ran on the Insomnia client, fails when ran from my application with the following error message:
"The request was aborted: Could not create SSL/TLS secure channel"
Here is the RestSharp code I am using, as generated from the Insomnia client's code generator
var client = new RestClient("my_api_endpoint");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "multipart/form-data; boundary=---011000010111000001101001");
request.AddCookie("PHPSESSID", "1dhpd76ip6o6hhle4ffg9tp30m");
request.AddParameter("multipart/form-data; boundary=---011000010111000001101001", "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nmy_user\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nmy_password\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"isbn\"\r\n\r\nmy_product_code\r\n-----011000010111000001101001--\r\n", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
What I have tried:
Adding any combination of the following three lines before the request is executed (I tried many different variants of the second line, none worked)
ServicePointManager.Expect100Continue = True
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12
ServicePointManager.ServerCertificateValidationCallback += Function(sender, certificate, chain, errors) True
Adding or reordering cipher suites to the client's server machine using IISCrypto, after using https://www.ssllabs.com/ssltest/ to determine the suites I needed to add/reorder.
However, none of the aforementioned seemed to solve the issue.