[mod_python] Client certificate?

Conrad Steenberg conrad at hep.caltech.edu
Tue Feb 26 10:49:54 EST 2002


Hi Rich

On Mon, 2002-02-25 at 17:52, Rich Salz wrote:
> I am sure there are other approaches, but here is what we did.
> 
> We were already using SWIG (www.swig.org).  I added ONE function to the
> the request object, get_swig_handle.  This returns a SWIG-compatible
> handle to the real apache request object:
> +static PyObject * req_get_swig_handle(requestobject *self, PyObject
> *args)
> +{
> +    char ptrbuff[128];
> +    SWIG_MakePtr(ptrbuff, (char *)self->request_rec, "_request_rec_p");
> +    return Py_BuildValue("s", ptrbuff);
> +}

Just to clarify, this was done in your own apache module or a patch to
mod_python?

> 
> Then it's pretty easy for us to write SWIG-wrapped functions that get
> any mod_ssl data we want:
> 
> int
> UsingSSL(request_rec* r)
> {
>     return ap_ctx_get(r->connection->client->ctx, "ssl") != NULL;
> }
> 

And this is in your own Python module (which was also linked against
apache)?

> 
> I can send more details if necessary ...

I think my flu-fried brain would appreciate it :-)

Conrad

-- 
*-----------------------------------------*
| Conrad Steenberg                        |
| Caltech, Mail Code 356-48               |
| Pasadena, CA, 91125                     |
| e-mail: conrad at hep.caltech.edu          |
| Tel: (626) 395-8758                     |
*-----------------------------------------*




More information about the Mod_python mailing list