one of the documented procedures in this installation of the ACS
events_securelink   new_page
What it does:
Allows you to create a relative link to a secure page
Defined in: /web/philip/tcl/events-defs.tcl

Source code:

    if {[ns_conn driver] == "nsssl"} {
        return $new_page
    } else {
        set new_url "https://[ns_config ns/server/[ns_info server]/module/nsssl Hostname]"

        set port [ns_config ns/server/[ns_info server]/module/nsssl Port]
        if {![empty_string_p $port] && ($port != 443)} {
           append new_url ":$port"

        if [string match /* $new_page] {
           append new_url $new_page
        } else {
           set current_url [ns_conn url]
           regexp {^(.*)/} $current_url match new_url_dir
           append new_url "$new_url_dir/$new_page"
        return $new_url