TsgcWebSocketServer › Properties › SSL
Enables TLS/SSL on the server so that clients can connect using wss:// or https://.
property SSL: Boolean read FSSL write FSSL default False;
False
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.
oServer := TsgcWebSocketServer.Create(nil);
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;