I am going to explore this more fully tomorrow but I am suspicious of the references to the aolserver config file in get_https_port because:
In the ns_openssl v2.x configuration, there is only one driver configured and only a single port is used. The parameter is called 'ns_param ServerPort' and is under ns_section "ns/server/${servername}/module/nsopenssl"
HOWEVER.......
In the ns_openssl v3.x configuration, there are multiple drivers on multiple ports. This means that the secure ports are actually contained in:
ns_section "ns/server/${servername}/module/nsopenssl/ssldriver/users",
ns_section "ns/server/${servername}/module/nsopenssl/ssldriver/admins" and
ns_section "ns/server/${servername}/module/nsopenssl/ssldriver/clients".
Furthermore, in each case the port number is contained in 'ns_param port' instead of 'ns_param ServerPort' as with v2.x.
(See http://aolserver.cvs.sourceforge.net/viewvc/aolserver/nsopenssl/nsd.tcl?revision=1.13&view=markup&sortby=author)
I therefore have my doubts that the following code will work with an aolserver configuration file in which ns_openssl v.3.x style config has been used.
ad_proc -private security::get_https_port {} {
Return the HTTPS port specified in the AOLserver config file.
@return The HTTPS port or the empty string if none is configured.
@author Peter Marklund
} {
set ssl_port ""
if { [ns_config ns/server/[ns_info server]/modules nsssl] != "" } {
set ssl_port [ns_config -int "ns/server/[ns_info server]/module/nsssl" Port 443]
} elseif { [ns_config ns/server/[ns_info server]/modules nsopenssl] != "" } {
set ssl_port [ns_config -int "ns/server/[ns_info server]/module/nsopenssl" ServerPort 443]
} elseif { [ns_config ns/server/[ns_info server]/modules nsssle] != "" } {
set ssl_port [ns_config -int "ns/server/[ns_info server]/module/nsssle" Port 443]
}
return $ssl_port
}
Nevertheless, I am still not sure why my server doesn't issue a redirect to https://xxx.xxx.xxx.xxx:443/register/ which is what I would have expected to happen even if this code is flawed.
Any thoughts?