45
mod_stunnel: Apache+stunnel glue
Overrides getpeername()
Returns IP address of actual client
Emulates mod_ssl environment
int mod_stunnel_post_read_request (request_rec *r) {
  if (ntohs(r->connection->local_addr.sin_port) == 443) {
    ap_ctx_set(r->ctx, "ap::http::method", "https");
    ap_ctx_set(r->ctx, "ap::default::port", "443");
    ap_table_set(r->subprocess_env, "HTTPS", "on");
  }
  return DECLINED;
}