one of the documented procedures in this installation of the ACS
What it does:
If the current page isn't secure, will ns_redirect the user to the https version of the page. If the nsssl module isn't installed, the function will return 0 but not try to redirect. Uses the nssssl/Port entry in the .ini file to guess the secure port (or will leave it off if the port isn't specified (in which case we're using the default https port)).
Defined in: /web/philip/tcl/events-defs.tcl

Source code:

    if {[ns_conn driver] == "nsssl"} {
        # we don't need to do anything
        return 1
    } else {
        if [empty_string_p [ns_config ns/server/[ns_info server]/modules nsssl]] {
            # we don't have ssl installed. Give up.
            return 0
        } else {
            set secure_url "https://[ns_config ns/server/[ns_info server]/module/nssock Hostname]"
            set secure_port [ns_config ns/server/[ns_info server]/module/nsssl Port]
            if ![empty_string_p $secure_port] {
                append secure_url ":$secure_port"
            append secure_url [ns_conn url]
            set query_string [ns_conn query]
            if ![empty_string_p $query_string] {
                append secure_url "?$query_string"
            ad_returnredirect $secure_url