andremussche / DelphiWebsockets

Websockets and Socket.io for Delphi
251 stars 128 forks source link

ssl for websocket server #22

Open qiin opened 7 years ago

qiin commented 7 years ago

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;

leolamau commented 7 years ago

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