Use the "ssl_is_https" definition from mod_ssl.h.