httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Taisuke Yamada <tyamad...@list.rakugaki.org>
Subject Re: How to get mod_ssl's SSL_CTX from another module?
Date Tue, 19 Dec 2006 04:25:31 GMT
> So, how do I get the current SSL_CTX (and/or SSL) structure?

I've done that in 1.3 days, and now it seems you can refer to it
through process_rec->pool->user_data:

> [modules/ssl/README]
> Eliminated ap_global_ctx. Storing Persistant information in
> process_rec->pool->user_data. The ssl_pphrase_Handle_CB() and
> ssl_config_global_* () functions have an extra parameter now -
> "server_rec *" -  which is used to retrieve the SSLModConfigRec.

I did it like below (for 1.3):

  #include "mod_ssl.h"
  ...
  #define myModConfig() \
    (SSLModConfigRec *)ap_ctx_get(ap_global_ctx, "ssl_module")
  ...
  rec = myModConfig();
  ssl_asn1_t *asn1 = (ssl_asn1_t *)ssl_ds_table_get(rec->tPrivateKey);
  asn1->nData;  // length of certificate
  asn1->cpData; // certificate data in DER format

I've never done it on 2.x, through.

--
Taisuke Yamada <tai@rakugaki.org>, http://rakugaki.org/
5229 959A C85D 3C21 923A  41BD 5D60 D687 701E 5AA9

Mime
View raw message