How to keep common name of SSL while changing port wss

Viewed 130

I have a problem here. I created a windows app that requires interaction between browser and desktop apps. In the desktop app, I include WebSocket Secure made by [Dave](WebSocket Server in C#).

I have a valid pfx file. While using the default port (443), everything runs smoothly. The URL shows the CN of the SSL. My window app then has to use other port other than default ones (443), when I change in setting it runs not as per CN of the SSL but instead localhost:portnum. how to make it run using CN in ports other than 443? Please help.

1 Answers

I will try to answer this.

I have checked the link that you have pasted and came across the following code snippet:

private static void Main(string[] args){

IWebSocketLogger logger = new WebSocketLogger();

try
{
    string webRoot = Settings.Default.WebRoot;
    int port = Settings.Default.Port;

    // used to decide what to do with incoming connections
    ServiceFactory serviceFactory = new ServiceFactory(webRoot, logger);

    using (WebServer server = new WebServer(serviceFactory, logger))
    {
        server.Listen(port);
        Thread clientThread = new Thread(new ParameterizedThreadStart(TestClient));
        clientThread.IsBackground = false;
        clientThread.Start(logger);
        Console.ReadKey();
    }
}
catch (Exception ex)
{
    logger.Error(null, ex);
    Console.ReadKey();
}
}

Within the try block there is this code line:

int port = Settings.Default.Port;

Maybe trying setting that to an auto assign port fix your problem.

Related