01-19-2024, 07:36 PM
(This post was last modified: 01-19-2024, 07:42 PM by Alexandre Machado.)
Yes, it is possible (and quite common) but it is the same application running both as HTTPS and HTTP.
@Jeroen's answer is correct, but there is no need to have custom code to make both bindings.... ServerController.SSLOptions.Port is also used to configure Http.sys servers.
In this case, you just need to set:
What will determine the behavior of the application is the property
ServerController.SSLOptions.NonSSLRequest
It can be either: nsAccept (default), nsRedirect and nsBlock
nsAccept: incoming requests using HTTP port will be accepted and everything will run using HTTP only protocol
nsRedirect: any incoming request using HTTP port will be redirected to HTTPS port (if HTTPS is enabled, i.e. you have ServerController.SSLOptions.Port > 0)
nsBlock: any incomping request using HTTP port will be blocked. In this case the HTTP server won't even listen to the HTTP. No response for HTTP request will be generated.
You can also have forms that are only accessible via HTTPS or HTTP and others that are accessibla via both protocols. In that case you need to use the property
IWForm.ConnectionMode
It can be either:
cmAny (default): HTTP and HTTPS are accepted
cmSecure: Form will only accept HTTPS
cmNonSecure: Form will only accept HTTP
@Jeroen's answer is correct, but there is no need to have custom code to make both bindings.... ServerController.SSLOptions.Port is also used to configure Http.sys servers.
In this case, you just need to set:
Code:
ServerController.Port := (your HTTP port, default is 80)
ServerController.SSLOptions.Port := (your HTTPS port, default is 443)What will determine the behavior of the application is the property
ServerController.SSLOptions.NonSSLRequest
It can be either: nsAccept (default), nsRedirect and nsBlock
nsAccept: incoming requests using HTTP port will be accepted and everything will run using HTTP only protocol
nsRedirect: any incoming request using HTTP port will be redirected to HTTPS port (if HTTPS is enabled, i.e. you have ServerController.SSLOptions.Port > 0)
nsBlock: any incomping request using HTTP port will be blocked. In this case the HTTP server won't even listen to the HTTP. No response for HTTP request will be generated.
You can also have forms that are only accessible via HTTPS or HTTP and others that are accessibla via both protocols. In that case you need to use the property
IWForm.ConnectionMode
It can be either:
cmAny (default): HTTP and HTTPS are accepted
cmSecure: Form will only accept HTTPS
cmNonSecure: Form will only accept HTTP

