-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publisher cannot get ssl cert from workload api, HTTPS API returning SSL_ERROR_SYSCALL error #2101
Comments
* Move Industrial IOT to .net 8 * Order value changes by timestamp on arrival * Site name fix in deployment templates * Add workaround for rootless .net images in deployments and samples * Runtime state reporting with timestamp * Better error logs during metadata collection * Diagnostics collect and send * Addresses #2112, #2111, #2110, #2108, #2101
The issue happens only when running in Iot edge. The server certificate produced by the workload API is wrong somehow (looks like the private key is missing). I have added code to check that a private key exists in it, and if not fall back to generating a self signed certificate (like when running outside iot edge). Could you test the preview build published under tag '2.9.3-preview3' and if you still see issues, send me the log of OPC Publisher starting? |
I'll need some time to get back to this topic and find time for testing but I'll do that. |
We have a feature (#2081) that I have opened that is tracking this for the application certificate. We could expand this to also provision the ssl certificate. I cannot talk to timing though. |
Actually this is not what I asked. The original idea to reuse already enrolled certificate of the host is actually perfect. |
Agreed. I re-open to track this down with IoT Edge team. |
Issue lies in an incompatibility with .net.
|
Fix is in main and will be in 2.9.4-preview1 |
Describe the bug
When calling publisher HTTP API via HTTPS like i.e.
curl https://****:9705/swagger/v2/openapi.json
or
curl -X POST https://*****:9705/v2/configuration/diagnostics
following error occurs:
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to *****:9705
Following is logged in the log of the publisher module:
[16:04:17.2977] dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[39] Connection id "0HMV0DH6G5AMO" accepted. [16:04:17.2978] dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[1] Connection id "0HMV0DH6G5AMO" started. [16:04:17.3094] dbug: Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware[1] => ConnectionId:0HMV0DH6G5AMO Failed to authenticate HTTPS connection. System.Security.Authentication.AuthenticationException: The server mode SSL must use a certificate with the associated private key. at System.Net.Security.SslStream.AcquireServerCredentials(Byte[]& thumbPrint) at System.Net.Security.SslStream.GenerateToken(ReadOnlySpan
1 inputBuffer, Byte[]& output)at System.Net.Security.SslStream.NextMessage(ReadOnlySpan
1 incomingBuffer) at System.Net.Security.SslStream.ProcessBlob(Int32 frameSize) at System.Net.Security.SslStream.ReceiveBlobAsync[TIOAdapter](CancellationToken cancellationToken) at System.Net.Security.SslStream.ForceAuthenticationAsync[TIOAdapter](Boolean receiveFirst, Byte[] reAuthenticationData, CancellationToken cancellationToken) at Microsoft.AspNetCore.Server.Kestrel.Https.Internal.HttpsConnectionMiddleware.OnConnectionAsync(ConnectionContext context) [16:04:17.3106] dbug: Microsoft.AspNetCore.Server.Kestrel.Connections[2] Connection id "0HMV0DH6G5AMO" stopped. [16:04:17.3109] dbug: Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets[7] Connection id "0HMV0DH6G5AMO" sending FIN because: "The Socket transport's send loop completed gracefully."
Calling the API methods via HTTP is working as expected.
I followed descriptions #calling-the-api-over-http and #built-in-http-api-server but used different host ports then described there.
To Reproduce
Steps to reproduce the behavior:
, "PortBindings": { "80/tcp": [ { "HostPort": "9704" } ], "443/tcp": [ { "HostPort": "9705" } ] } }, "ExposedPorts": { "443/tcp": {}, "80/tcp": {} }
curl https://****:9705/swagger/v2/openapi.json
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to *****:9705
Expected behavior
The called API method should return a response just like calling via HTTP is doing.
Desktop (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: