Forum > Networking and Web Programming
is it possible for indy10 https to work on port not 443?
Thaddy:
If you need the functionality you can use fcl-net and fcl-web from current trunk (note that new code will compile in 3.0.4 as well). That is not Indy, though...but is up to date since a couple of weeks.
Michael Collier:
Ok my bad, I was confused by the fact that my raspberry pi works with indy10 SSL albeit only on port 443 and is showing "OpenSSL 1.1.0k 28 May 2019"
I guess the PI has some older libraries on it..
Thanks for help
Mike
Michael Collier:
--- Quote from: Thaddy on September 04, 2019, 08:51:18 am ---If you need the functionality you can use fcl-net and fcl-web from current trunk (note that new code will compile in 3.0.4 as well). That is not Indy, though...but is up to date since a couple of weeks.
--- End quote ---
Thanks I'll give it a go later, I'm updating a WST application that has option to run under indy/synapse so I'm doing them first.
Cheers,
Mike
Sartaj:
I faced same issue and found correct answer:- use OnQuerySSLPort handler to enable SSL on non standard port otherwise it will work as HTTP server on non standard port.
procedure TShttpsServer.HandleSslQuery(APort: TIdPort; var VUseSSL: Boolean);
begin
VUseSSL := True;
APort := 8080;
end;
Remy Lebeau:
--- Quote from: Sartaj on August 12, 2024, 08:29:19 pm ---I faced same issue and found correct answer:- use OnQuerySSLPort handler to enable SSL on non standard port otherwise it will work as HTTP server on non standard port.
--- End quote ---
That is correct. The OnQuerySSLPort event tells you which port a client has connected to, and then you return whether that port should use SSL/TLS or not. TIdHTTPServer will use SSL/TLS on the standard HTTPS port 443 by default, but you need to use the OnQuerySSLPort event to activate SSL/TLS on any other non-standard port.
--- Quote from: Sartaj on August 12, 2024, 08:29:19 pm ---procedure TShttpsServer.HandleSslQuery(APort: TIdPort; var VUseSSL: Boolean);
begin
VUseSSL := True;
APort := 8080;
end;
--- End quote ---
You are telling the server to use SSL/TLS for all clients unconditionally, regardless of which port each client has connected to. If you only have HTTPS ports, that's fine. But if you need to listen on both HTTP and HTTPS ports then your handler needs to look more like this instead:
--- Code: ---procedure TShttpsServer.HandleSslQuery(APort: TIdPort; var VUseSSL: Boolean);
begin
VUseSSL := (APort = 8080); // whatever ports your HTTPS bindings are listening on
end;
--- End code ---
Navigation
[0] Message Index
[*] Previous page