TsgcWebSocketProxyServer › Properties › SSL
Enables TLS/SSL on the downstream listener so that clients can connect to the proxy using wss:// or https://.
property SSL: Boolean read FSSL write FSSL default False;
False
Set SSL to True to accept secure connections on the downstream side. You must also configure the certificate material in SSLOptions (CertFile, KeyFile, RootCertFile, Password) and set SSLOptions.Port to the TLS port. This property only affects the downstream endpoint exposed to clients; whether the proxy connects to the upstream server over TLS is controlled separately by Proxy.TLS. Certificates must be supplied in PEM format.
oProxy := TsgcWebSocketProxyServer.Create(nil);
oProxy.SSL := true;
oProxy.SSLOptions.CertFile := 'c:\certificates\mycert.pem';
oProxy.SSLOptions.KeyFile := 'c:\certificates\mycert.pem';
oProxy.SSLOptions.RootCertFile := 'c:\certificates\mycert.pem';
oProxy.SSLOptions.Port := 443;
oProxy.Port := 443;
oProxy.Proxy.Host := 'upstream.example.com';
oProxy.Proxy.Port := 8080;
oProxy.Active := true;