TsgcWebSocketServerProperties › SSL

SSL Property

Enables TLS/SSL on the server so that clients can connect using wss:// or https://.

Syntax

public bool SSL { get; set; }

Default Value

False

Remarks

Set SSL to True to accept secure connections. You must also configure the certificate material in SSLOptions (CertFile, KeyFile, RootCertFile, Password) and set SSLOptions.Port to the TLS port. The same server can serve both plain and encrypted endpoints by adding several Bindings entries and keeping SSL=True; the server automatically attaches the TLS handler to the secure port only. Certificates must be supplied in PEM format.

Example


oServer = new TsgcWebSocketServer();
oServer.SSL = true;
oServer.SSLOptions.CertFile = "c:\\certificates\\mycert.pem";
oServer.SSLOptions.KeyFile = "c:\\certificates\\mycert.pem";
oServer.SSLOptions.RootCertFile = "c:\\certificates\\mycert.pem";
oServer.SSLOptions.Port = 443;
oServer.Port = 443;
oServer.Active = true;

Back to Properties