Subject: OT: Getting ssl information in another module

From: Erik Axel Nielsen <[email-masked]>
Date: 12 May 2002 21:04:29 +0200

Hi

I'm developing a "new" Apache mod called mod_log_sql. As the name
suggests it logs
Apache-logs into a relational database. 
My work is based upon mod_log_mysql and mod_log_config. 
mod_log_mysql is a very fine module, but it doesn't support Apache 2.0.
Therefore I decided to make a new one. Anyways, in mod_log_mysql SSL
logging
is provided with the following function:
---codestart---

static const char *extract_ssl_cipher(request_rec *r, char *a)
{
        char *result = NULL;
        
        if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL) {
            result = ssl_var_lookup(r->pool, r->server, r->connection,
r, "SSL_CIPHER");
                #ifdef DEBUG
            ap_log_error(APLOG_MARK,DEBUGLEVEL,r->server,"SSL_CIPHER:
%s", result);
                #endif
                if (result != NULL && result[0] == '\0')
              result = NULL;
                return result;
        } else {
                return "-";
        }
}
---codeend---

I have been looking all over (apache search, google, and in the source)
for an description for the ap_ctx_get
function and haven't found anything. 
I wondered if you could give me a hint on where I could get the
information to:
1. check if mod_ssl is used (a https:// request)
2. Get the cipher,key and maxkey.

Any help would be very apreciated.

Regards

Erik Axel Nielsen
Illumina DA

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [email-masked]
Automated List Manager                            [email-masked]

---

From: Cliff Woolley <[email-masked]>
Date: Sun, 12 May 2002 19:28:18 -0400 (EDT)

> function and haven't found anything.

ap_ctx_* were part of Ralf's EAPI extensions to Apache, which were a set
of patches that had to be applied to Apache in order for mod_ssl to work.
EAPI for 1.3.x was distributed with mod_ssl.  It no longer applies.

> 2. Get the cipher,key and maxkey.

You might want to ask these on [email-masked].  I'd answer them
myself but I don't know the answers.  The optional
function ssl_lookup_var() would probbly help out though.

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   [email-masked]
   Charlottesville, VA