Skip to content
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

Support PollingOverWebSocket for net60 Services #259

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nathanwoctopusdeploy
Copy link
Contributor

@nathanwoctopusdeploy nathanwoctopusdeploy commented Jul 6, 2023

Background

This PR adds support for WebSocket Services on net60. This will allow net60 Tentacles on Windows and Linux to support PollingOverWebSockets

This does not change the Client requirements e.g. Octopus Server, which must still be run on Windows (net48 or net60) as HttpListener doesn't support SSL binding in net60 on Linux

Results

Before

PollingOverWebSocket Services (Tentacles) had to be run on Windows under net48

After

PollingOverWebSocket Services (Tentacles) can be run on Windows under net48 and net60 and on Linux under net60

How to review this PR

Quality ✔️

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

@nathanwoctopusdeploy nathanwoctopusdeploy force-pushed the sast/improve-websocket-support-in-clientandservicebuilder branch 2 times, most recently from 07eccfc to 0b9d243 Compare July 6, 2023 22:26
Base automatically changed from sast/improve-websocket-support-in-clientandservicebuilder to main July 6, 2023 23:56
@nathanwoctopusdeploy nathanwoctopusdeploy force-pushed the sast/everyone-gets-websockets branch 2 times, most recently from 607513e to 1fa23ab Compare July 21, 2023 03:08
@nathanwoctopusdeploy nathanwoctopusdeploy changed the title Everyone gets WebSockets Support PollingOverWebSocket for net60 Services Jul 21, 2023
@@ -8,7 +8,7 @@ static class WebSocketSslCertificateHelper
{
internal static void AddSslCertToLocalStore()
{
var store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux LocalMachine is read-only

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is adding support for websockets on linux?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ability to install the cert on Linux, we still have an issue where we can't run any tests due to pollingoverwebsockets Client not being able to bind to an SSL port on Linux

#if SUPPORTS_WEB_SOCKET_CERTIFICATE_VALIDATION_CALLBACK
clientWebSocket.Options.RemoteCertificateValidationCallback = WebSocketServerCertificateValidationCallback(clientWebSocket.Options.RemoteCertificateValidationCallback, connectionId);
#endif
ServicePointManager.ServerCertificateValidationCallback = ServerCertificateValidationCallback(ServicePointManager.ServerCertificateValidationCallback);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both to be registered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I'll have a play and see!!

@nathanwoctopusdeploy
Copy link
Contributor Author

[sc-53419]

@shortcut-integration
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants