Check for SSL in OnConnect and onHTTPSessionCreate

How can I check if a connection uses SSL? I’m building a custom redirector, and in the onHTTPSessionCreate I need to know if the user connected with HTTP or HTTPS, and same for RTMP and RTMPS in OnConnect.