WebRequest .NET object getting error on GetRequestStream()

David Thayer 1 Reputation point
2020-10-16T19:18:10.873+00:00

I am requesting data from a server in another part of our cmpany and this has been working well for many months. Last night My computer rebooted to apply an update from Windows and suddenly I am getting the following error.


https://apidev.wecon.com/ws/rest/AG-PUBGEN/inventory/v3 had no response. Errors: No valid data returned from JDE API.
ExceptionMsg: The request was aborted: Could not create SSL/TLS secure channel.


This API does not use any certificates to create a connection. What could have suddenly changed?

Here is the relevant code:

var webRequest = WebRequest.Create(newUrl.Trim());
webRequest.ContentType = "application/json";
webRequest.Method = method;
var authInfo = boomiUser + ":" + boomiPassword;
var auth = Convert.ToBase64String(Encoding.Default.GetBytes(authInfo));
webRequest.Headers.Add("Authorization", auth);
int timeout = JdeUtility.GetLocalConfigurationValue<int>("JdeApiTimeout", 300000);
webRequest.Timeout = timeout;

            Job.Report("JdeApi", () => $"Jde Endpoint timeout was set to {timeout / 1000} seconds", 10, ConsoleColor.Yellow);
            if (method != "GET")
                using (var requestStream = webRequest.GetRequestStream())
                {
                    requestStream.Write(body, 0, body.Length);
                }

            using (var webResponse = webRequest.GetResponse())
            {
                results.ResponseHeaders = webResponse.Headers;
                using (var responseStream = webResponse.GetResponseStream())
                {

Error is being thrown at webResponse.GetResponseStream.

Universal Windows Platform (UWP)
{count} votes