andremussche/DelphiWebsockets

ssl for websocket server

qiin opened this issue · 1 comments

qiin commented

Hi,andremussche!,Thanks for you DelphiWebsockets.
I use TIdWebsocketServer for ssl,then can access my host(https://10.11.12.14:443) through internet browser.But use TIdHTTPWebsocketClient access hint: Error while upgrading:"200:HTTP/1.1 200 OK" .
Maybe i can't use it correctly。
My code:
server := TIdWebsocketServer.Create(Self);
server.DefaultPort := 80;
server.Bindings.Clear;
Binding := Server.Bindings.Add;
Binding.IP := '10.11.12.14';
Binding.Port := 443;
IdServerIOHandlerSSLOpenSSL1.SSLOptions.RootCertFile := '....1_root_bundle.crt';
IdServerIOHandlerSSLOpenSSL1.SSLOptions.CertFile := '.com.crt';
IdServerIOHandlerSSLOpenSSL1.SSLOptions.KeyFile := '..key';
server.IOHandler := self.IdServerIOHandlerSSLOpenSSL1;

Yeah you need to modify the pas file.. look at the issue #23 that i submitted a code change request.