Apache Mod-Python - Updated: (MODPYTHON-94) Calling APR optional functions provided by mod_ssl

This is Interesting: Free IT Magazines  
Home > Archive > Apache Mod-Python > November 2005 > Updated: (MODPYTHON-94) Calling APR optional functions provided by mod_ssl





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Updated: (MODPYTHON-94) Calling APR optional functions provided by mod_ssl
Deron Meranda (JIRA)

2005-11-28, 5:57 pm

[ http://issues.apache.org/jira/brows...HON-94?page=all ]

Deron Meranda updated MODPYTHON-94:
-----------------------------------

Attachment: requestobject.c.patch

This is a suggested patch against 3.2.5b which adds the ability to
access a couple mod_ssl optional functions.

I added two new methods to the request object.

req.is_https()
req.ssl_var()

which will invoke the mod_ssl optional functions ssl_is_https()
and ssl_var_lookup(). They safely handle the case where
mod_ssl is not loaded or not available.

They also work perfectly fine from say the PythonAccessHandler
phase, whereas using subprocess_env does not.

Some of the code was inspired from the mod_rewrite invocation
of these same mod_ssl optional functions. Especially the part about
declaring the function rather than including modssl.h.

> Calling APR optional functions provided by mod_ssl
> --------------------------------------------------
>
> Key: MODPYTHON-94
> URL: http://issues.apache.org/jira/browse/MODPYTHON-94
> Project: mod_python
> Type: New Feature
> Components: core
> Versions: 3.2
> Environment: Apache 2
> Reporter: Deron Meranda
> Attachments: requestobject.c.patch
>
> mod_python is not able to invoke APR Optional Functions. There are
> some cases however where this could be of great benifit.
> For example, consider writing an authentication or authorization handler
> which needs to determine SSL properties (even if to just answer the
> simple question: is the connection SSL encrypted). The normal way of
> looking in the subprocess_env for SSL_* variables does not work in those
> early handler phases because those variables are not set until the fixup phase.
> The mod_ssl module though does provide both a ssl_is_https() and
> ssl_var_lookup() optional functions which can be used in earlier
> phases. For example look at how mod_rewrite calls those; using
> the APR_DECLARE_OPTIONAL_FN and APR_RETRIEVE_OPTIONAL_FN
> macros.
> I can see how it might be very hard to support optional functions in
> general because of the C type linkage issue, but perhaps a select few
> could be coded directly into mod_python.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com