2

I’m running into an issue getting wss:// to work on version 3.06 in production.

I’ve been able to get it working in a test environment locally (see test environment settings at the end).

If I used ws:// and not wss://, the production server works

In production I get the following error: net::ERR_CONNECTION_REFUSED

(Note: when I use ws://, I’ve switched over my test web site to http:// and not https://

Production environment:

  1. 2 separate Web servers running a web application (load balanced)
  2. 1 separate server running XSockets v3.06 (as a Windows Service)
  3. All servers are in a sub domain:

a. Web server: web1.acme.com b. Xsocket Server: commbus.acme.com

(Note: I’m not showing the real domain name here (acme))

  1. All servers are using the same wildcard certificate “cn=*.acme.com”
  2. All servers are behind a firewall.

I’ve tried using a ConfigurationSettings class with the following different constructors: (Note: the 192.168.1.1 is not the real internal IP we use but it’s similar)

1) I used this option because it worked in the test environment

public class SecureConfig : ConfigurationSetting
{
        public SecureConfig()
            : base()
        {}
}

2)

public SecureConfig()
 : base(new Uri("wss://commbus.acme.com:4502"), new Uri("wss://192.168.1.1:4502"))
 {
     this.CertificateLocation = StoreLocation.LocalMachine;
     this.CertificateSubjectDistinguishedName = "cn=*.acme.com";
}

3) public SecureConfig() : base(new Uri("wss://commbus.acme.com:4502"), new Uri("wss://192.168.1.1:4502")) {

4)

public SecureConfig()
 : base(new Uri("wss://commbus.acme.com:4502")
 {}

5)

public SecureConfig()
 : base(new Uri("wss://commbus.acme.com:4502")
 {
     this.CertificateLocation = StoreLocation.LocalMachine;
     this.CertificateSubjectDistinguishedName = "cn=*.acme.com";
}

Test environment:

To verify that I can setup wss://. I’ve been able to do the following test:

1) Run IIS Express locally with HTTPS 2) Run the XSockets code in a console application

(Note: All XSockets code is in a separate library assembly and the same library assembly is used in both my test console application and production)

3) For the test I used the certificate “cn=localhost”

This worked fine if I used the following in a ConfiguationSetting Class:

public class SecureConfig : ConfigurationSetting
{
        public SecureConfig()
            : base()
        {

        }
}

Behavior I’ve notice with the testing site:

I would get the same error in production if I used the following contructors for the ConfigurationSettings class:

public SecureConfig()
            : base(new Uri("wss://localhost:4502"))
{

}

Or

public SecureConfig()
            : base(new Uri("wss://localhost:4502"))
        {
            this.CertificateLocation = StoreLocation.LocalMachine;
            this.CertificateSubjectDistinguishedName = "cn=local";
       }

I’m not sure what I’m missing.

Patrice
  • 4,641
  • 9
  • 33
  • 43
scornell
  • 41
  • 2

1 Answers1

2

I was able to get it working.

I had to load the certificate from the file system.

public class SecuritConfig: ConfigurationSetting
{
public SecureConfig():base(new Uri("wss://commbus.acme.com"), new Uri("wss://192.168.1.100"))
{
           this.Certificate = new X509Certificate2("wildcard.acme.com.pfx", "pwd");
}
}
scornell
  • 41
  • 2