Unlike windows, the Linux network layer does not support overriding ssl certificate validation. You must add the certificate as a trusted.
how this is done will depend on your distro.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Using dotnet 7 my application calls a https api service in my local network with self signed certificate.
I run it from a Windows client and I have no problems.
I run it from a linux arm raspberry device and I have the following exception:
"One or more errors occurred. (The SSL connection could not be established, see inner exception.)"
and the inner exception is "Received an unexpected EOF or 0 bytes from the transport stream."
This is the code:
private void testConn(string apiUrl, LoginPostData loginData)
{
var handler = new HttpClientHandler();
handler.ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
//handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => { return true; };
HttpClient client = new HttpClient(handler);
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Task<HttpResponseMessage> response = client.PostAsJsonAsync(apiUrl, loginData);
//...
}
Unlike windows, the Linux network layer does not support overriding ssl certificate validation. You must add the certificate as a trusted.
how this is done will depend on your distro.
(Extra post to show previous)