Communication "Server / Service" for older .NET Framework application
-
Hi everyone, hard to phrase a title for what i am looking for, therefore following explanation. I have the requirement to establish communication to a device via Secure WebSockets using TLS 1.3 and need to research on how i can do that from our applications that sadly are running with .NET Framework 4.0. What i found out yet is that it might be a pain to get Secure WebSockets with TLS 1.3 running with that old framework and therefore i need to find a proper solution on how to circumnavigate this issue. My Idea: The old application will talk with a service / server specifically designed to just do the communication part, meaning the old stuff doesn't get touched and the service can run with .NET 8, which obviously should support the requirement. What my questions are: Does anyone have an idea or can point me into the right direction in terms of: - How do they both communicate with each other (I would prefer not to use any COM stuff if possible) - What type of project to use for the .NET 8 app? --> I heard of the "Worker services in .NET" which seems the right thing to me, since the "service" needs to be run on demand (Only if required to be used), should support multiple connections and should not show stuff on a console while running. Since the idea is to have a "secure" connection it would be strange if all the info can be read via COM communication. On the other hand that's a fairly new area for me, so i have no clue if that is just the way to go and does work "secure" as well. My head just says COM sounds old and may be wrong, but don't hate me for that :suss: Additionally: Regarding installation or installation of a "Service" there won't be much of issue afaik, in the end the user simply doesn't care, shouldn't know or bother how the magic works behind the UI. Many thanks in advance!
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found"); -
Hi everyone, hard to phrase a title for what i am looking for, therefore following explanation. I have the requirement to establish communication to a device via Secure WebSockets using TLS 1.3 and need to research on how i can do that from our applications that sadly are running with .NET Framework 4.0. What i found out yet is that it might be a pain to get Secure WebSockets with TLS 1.3 running with that old framework and therefore i need to find a proper solution on how to circumnavigate this issue. My Idea: The old application will talk with a service / server specifically designed to just do the communication part, meaning the old stuff doesn't get touched and the service can run with .NET 8, which obviously should support the requirement. What my questions are: Does anyone have an idea or can point me into the right direction in terms of: - How do they both communicate with each other (I would prefer not to use any COM stuff if possible) - What type of project to use for the .NET 8 app? --> I heard of the "Worker services in .NET" which seems the right thing to me, since the "service" needs to be run on demand (Only if required to be used), should support multiple connections and should not show stuff on a console while running. Since the idea is to have a "secure" connection it would be strange if all the info can be read via COM communication. On the other hand that's a fairly new area for me, so i have no clue if that is just the way to go and does work "secure" as well. My head just says COM sounds old and may be wrong, but don't hate me for that :suss: Additionally: Regarding installation or installation of a "Service" there won't be much of issue afaik, in the end the user simply doesn't care, shouldn't know or bother how the magic works behind the UI. Many thanks in advance!
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");HobbyProggy wrote:
TLS 1.3 running
C# doesn't do TLS unless both the libraries and OS have the correct versions. Following has the magic of SecurityProtocolType.Tls12 and comment mentions the version of .Net needed. https://stackoverflow.com/questions/55240173/how-to-handle-httpwebrequest-c-sharp-with-tls-1-3[^] For OS following claims Windows server 2022 is needed. Although I thought there was a prior version where it could be turned on. TLS1.3 is it supported? - Microsoft Q&A[^] There are also encryption protocols that must be enabled or disabled. Now all of the above is to make it easy. Question might be if someone could add a native library of some sort (not C#) and implement it from scratch. After all linux presumably has it and that means the code should exist. But I have not researched that myself.
-
Hi everyone, hard to phrase a title for what i am looking for, therefore following explanation. I have the requirement to establish communication to a device via Secure WebSockets using TLS 1.3 and need to research on how i can do that from our applications that sadly are running with .NET Framework 4.0. What i found out yet is that it might be a pain to get Secure WebSockets with TLS 1.3 running with that old framework and therefore i need to find a proper solution on how to circumnavigate this issue. My Idea: The old application will talk with a service / server specifically designed to just do the communication part, meaning the old stuff doesn't get touched and the service can run with .NET 8, which obviously should support the requirement. What my questions are: Does anyone have an idea or can point me into the right direction in terms of: - How do they both communicate with each other (I would prefer not to use any COM stuff if possible) - What type of project to use for the .NET 8 app? --> I heard of the "Worker services in .NET" which seems the right thing to me, since the "service" needs to be run on demand (Only if required to be used), should support multiple connections and should not show stuff on a console while running. Since the idea is to have a "secure" connection it would be strange if all the info can be read via COM communication. On the other hand that's a fairly new area for me, so i have no clue if that is just the way to go and does work "secure" as well. My head just says COM sounds old and may be wrong, but don't hate me for that :suss: Additionally: Regarding installation or installation of a "Service" there won't be much of issue afaik, in the end the user simply doesn't care, shouldn't know or bother how the magic works behind the UI. Many thanks in advance!
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");Transport Layer Security (TLS) best practices with .NET Framework | Microsoft Learn[^] There's no explicit mention of 4.0, as it's long out of support. Any Windows OS that supports TLS 1.3 will come with at least 4.6 installed, so why do you still need to target 4.0?
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
HobbyProggy wrote:
TLS 1.3 running
C# doesn't do TLS unless both the libraries and OS have the correct versions. Following has the magic of SecurityProtocolType.Tls12 and comment mentions the version of .Net needed. https://stackoverflow.com/questions/55240173/how-to-handle-httpwebrequest-c-sharp-with-tls-1-3[^] For OS following claims Windows server 2022 is needed. Although I thought there was a prior version where it could be turned on. TLS1.3 is it supported? - Microsoft Q&A[^] There are also encryption protocols that must be enabled or disabled. Now all of the above is to make it easy. Question might be if someone could add a native library of some sort (not C#) and implement it from scratch. After all linux presumably has it and that means the code should exist. But I have not researched that myself.
Good point, i'll have to check back with the hardware team then, cause they implement TLS 1.3 on the device and exepct us to connect to it via Secure Websockets and TLS 1.3.
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found"); -
Transport Layer Security (TLS) best practices with .NET Framework | Microsoft Learn[^] There's no explicit mention of 4.0, as it's long out of support. Any Windows OS that supports TLS 1.3 will come with at least 4.6 installed, so why do you still need to target 4.0?
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Thanks for the Link Richard, sometimes my google foo seems off... Uhm, long story short: There is a bunch of old men that define a standard i have to align to and use their libraries and software and put my stuff somewhere in-between. This application is running on 4.0.3 and that is why i am targeting that. The app loads my code and then i load the base stuff as well and all of that is compiled as 2.0 Standard. Therefore my thought of extracting this TLS / Websocket bit into a "Service / Server" my old fart code can communicate with. And i already found out that Pipes do work like a charm there.
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found"); -
Thanks for the Link Richard, sometimes my google foo seems off... Uhm, long story short: There is a bunch of old men that define a standard i have to align to and use their libraries and software and put my stuff somewhere in-between. This application is running on 4.0.3 and that is why i am targeting that. The app loads my code and then i load the base stuff as well and all of that is compiled as 2.0 Standard. Therefore my thought of extracting this TLS / Websocket bit into a "Service / Server" my old fart code can communicate with. And i already found out that Pipes do work like a charm there.
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found");HobbyProggy wrote:
This application is running on 4.0.3 ... compiled as 2.0 Standard
If you mean .NET Standard 2.0[^], that requires at least .NET Framework 4.6.1, and preferably 4.7.2 or higher. :)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
HobbyProggy wrote:
This application is running on 4.0.3 ... compiled as 2.0 Standard
If you mean .NET Standard 2.0[^], that requires at least .NET Framework 4.6.1, and preferably 4.7.2 or higher. :)
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
Exactly... well now i am really confused, my testing app is 4.7.2 but the version info of the official application is .NET 4.0.3. So additionally to not knowing 100% how all of that stuff works i even don't know how this specific works out! *edit* My Test app as well looks like .NET 4.0.3 or am i just dumb today?
Console output:
DeviceModel: .NET Version 4.0.30319.42000 'TestApp.exe' (CLR v4.0.30319:TestApp.exe): Loaded 'C:\ProgramData\...\Device.dll'.
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found"); -
Hi everyone, hard to phrase a title for what i am looking for, therefore following explanation. I have the requirement to establish communication to a device via Secure WebSockets using TLS 1.3 and need to research on how i can do that from our applications that sadly are running with .NET Framework 4.0. What i found out yet is that it might be a pain to get Secure WebSockets with TLS 1.3 running with that old framework and therefore i need to find a proper solution on how to circumnavigate this issue. My Idea: The old application will talk with a service / server specifically designed to just do the communication part, meaning the old stuff doesn't get touched and the service can run with .NET 8, which obviously should support the requirement. What my questions are: Does anyone have an idea or can point me into the right direction in terms of: - How do they both communicate with each other (I would prefer not to use any COM stuff if possible) - What type of project to use for the .NET 8 app? --> I heard of the "Worker services in .NET" which seems the right thing to me, since the "service" needs to be run on demand (Only if required to be used), should support multiple connections and should not show stuff on a console while running. Since the idea is to have a "secure" connection it would be strange if all the info can be read via COM communication. On the other hand that's a fairly new area for me, so i have no clue if that is just the way to go and does work "secure" as well. My head just says COM sounds old and may be wrong, but don't hate me for that :suss: Additionally: Regarding installation or installation of a "Service" there won't be much of issue afaik, in the end the user simply doesn't care, shouldn't know or bother how the magic works behind the UI. Many thanks in advance!
MessageBox.Show(!string.IsNullOrWhiteSpace(_signature)
? $"This is my signature:{Environment.NewLine}{_signature}": "404-Signature not found"); -
Did you try this approach: Using TLS 1.3 from .NET 4.0 Application – Medo's Home Page[^]
Interesting but keep in mind that the code as written does not 'use' TLS 1.3. Rather it attempts to specify it and then backs down if the system tells says it is not available. I suspect one would also want to verify that something else is not also doing a backdown even further down the line. (Keep in mind my first post where I mention that encryption algorithms might also be needed which is only determined by the windows OS.)