source: mod_gnutls/src/mod_gnutls.c @ 84cb5b2

debian/masterdebian/stretch-backportsjessie-backportsmsvaupstream
Last change on this file since 84cb5b2 was 84cb5b2, checked in by Paul Querna <chip@…>, 14 years ago
  • add lua to do client verification
  • only use gcrypt locking when required to
  • Property mode set to 100644
File size: 3.8 KB
Line 
1/**
2 *  Copyright 2004-2005 Paul Querna
3 *
4 *  Licensed under the Apache License, Version 2.0 (the "License");
5 *  you may not use this file except in compliance with the License.
6 *  You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 *  Unless required by applicable law or agreed to in writing, software
11 *  distributed under the License is distributed on an "AS IS" BASIS,
12 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 *  See the License for the specific language governing permissions and
14 *  limitations under the License.
15 *
16 */
17
18#include "mod_gnutls.h"
19
20
21static void gnutls_hooks(apr_pool_t * p)
22{
23    ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL,
24                           APR_HOOK_MIDDLE);
25    ap_hook_post_config(mgs_hook_post_config, NULL, NULL,
26                        APR_HOOK_MIDDLE);
27    ap_hook_child_init(mgs_hook_child_init, NULL, NULL,
28                       APR_HOOK_MIDDLE);
29#if USING_2_1_RECENT
30    ap_hook_http_scheme(mgs_hook_http_scheme, NULL, NULL,
31                        APR_HOOK_MIDDLE);
32#else
33    ap_hook_http_method(mgs_hook_http_scheme, NULL, NULL,
34                        APR_HOOK_MIDDLE);
35#endif
36    ap_hook_default_port(mgs_hook_default_port, NULL, NULL,
37                         APR_HOOK_MIDDLE);
38    ap_hook_pre_config(mgs_hook_pre_config, NULL, NULL,
39                       APR_HOOK_MIDDLE);
40   
41    ap_hook_access_checker(mgs_hook_authz, NULL, NULL, APR_HOOK_REALLY_FIRST);
42   
43    ap_hook_fixups(mgs_hook_fixups, NULL, NULL, APR_HOOK_REALLY_FIRST);
44   
45    /* TODO: HTTP Upgrade Filter */
46    /* ap_register_output_filter ("UPGRADE_FILTER",
47        *          ssl_io_filter_Upgrade, NULL, AP_FTYPE_PROTOCOL + 5);
48*/
49    ap_register_input_filter(GNUTLS_INPUT_FILTER_NAME,
50                             mgs_filter_input, NULL,
51                             AP_FTYPE_CONNECTION + 5);
52    ap_register_output_filter(GNUTLS_OUTPUT_FILTER_NAME,
53                              mgs_filter_output, NULL,
54                              AP_FTYPE_CONNECTION + 5);
55}
56
57static const command_rec mgs_config_cmds[] = {
58    AP_INIT_TAKE1("GnuTLSClientVerify", mgs_set_client_verify,
59                  NULL,
60                  RSRC_CONF|OR_AUTHCFG,
61                  "Set Verification Requirements of the Client Certificate"),
62    AP_INIT_TAKE1("GnuTLSClientCAFile", mgs_set_client_ca_file,
63                  NULL,
64                  RSRC_CONF,
65                  "Set the CA File for Client Certificates"),
66    AP_INIT_TAKE1("GnuTLSCertificateFile", mgs_set_cert_file,
67                  NULL,
68                  RSRC_CONF,
69                  "SSL Server Key file"),
70    AP_INIT_TAKE1("GnuTLSKeyFile", mgs_set_key_file,
71                  NULL,
72                  RSRC_CONF,
73                  "SSL Server Certificate file"),
74    AP_INIT_TAKE1("GnuTLSCacheTimeout", mgs_set_cache_timeout,
75                  NULL,
76                  RSRC_CONF,
77                  "Cache Timeout"),
78    AP_INIT_TAKE2("GnuTLSCache", mgs_set_cache,
79                  NULL,
80                  RSRC_CONF,
81                  "Cache Configuration"),
82    AP_INIT_TAKE1("GnuTLSEnable", mgs_set_enabled,
83                  NULL,
84                  RSRC_CONF,
85                  "Whether this server has GnuTLS Enabled. Default: Off"),
86    AP_INIT_RAW_ARGS("<GnuTLSRequire", mgs_set_require_section,
87                  NULL,
88                  EXEC_ON_READ|OR_ALL,
89                  "Whether this server has GnuTLS Enabled. Default: Off"),
90    AP_INIT_RAW_ARGS("GnuTLSRequireByteCode", mgs_set_require_bytecode,
91                     NULL,
92                     OR_ALL,
93                     "Internal Command for reading Lua Bytecode."),
94    {NULL}
95};
96
97module AP_MODULE_DECLARE_DATA gnutls_module = {
98    STANDARD20_MODULE_STUFF,
99    mgs_config_dir_create,
100    mgs_config_dir_merge,
101    mgs_config_server_create,
102    NULL,
103    mgs_config_cmds,
104    gnutls_hooks
105};
Note: See TracBrowser for help on using the repository browser.