Apache2
mod_md_config.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. 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 #ifndef mod_md_md_config_h
18 #define mod_md_md_config_h
19 
20 struct apr_hash_t;
21 struct md_store_t;
22 struct md_reg_t;
23 struct md_ocsp_reg_t;
24 struct md_pkeys_spec_t;
25 
26 typedef enum {
43 
44 typedef enum {
48 
49 typedef struct md_mod_conf_t md_mod_conf_t;
50 struct md_mod_conf_t {
51  apr_array_header_t *mds; /* all md_t* defined in the config, shared */
52  const char *base_dir; /* base dir for store */
53  const char *proxy_url; /* proxy url to use (or NULL) */
54  struct md_reg_t *reg; /* md registry instance */
55  struct md_ocsp_reg_t *ocsp; /* ocsp status registry */
56 
57  int local_80; /* On which port http:80 arrives */
58  int local_443; /* On which port https:443 arrives */
59  int can_http; /* Does someone listen to the local port 80 equivalent? */
60  int can_https; /* Does someone listen to the local port 443 equivalent? */
61  int manage_base_server; /* If base server outside vhost may be managed */
62  int hsts_max_age; /* max-age of HSTS (rfc6797) header */
63  const char *hsts_header; /* computed HTST header to use or NULL */
64  apr_array_header_t *unused_names; /* post config, names of all MDs not assigned to a vhost */
65  struct apr_hash_t *init_errors; /* init errors reported with MD name as key */
66 
67  const char *notify_cmd; /* notification command to execute on signup/renew */
68  const char *message_cmd; /* message command to execute on signup/renew/warnings */
69  struct apr_table_t *env; /* environment for operation */
70  int dry_run; /* != 0 iff config dry run */
71  int server_status_enabled; /* if module should add to server-status handler */
72  int certificate_status_enabled; /* if module should expose /.httpd/certificate-status */
73  md_timeslice_t *ocsp_keep_window; /* time that we keep ocsp responses around */
74  md_timeslice_t *ocsp_renew_window; /* time before exp. that we start renewing ocsp resp. */
75  const char *cert_check_name; /* name of the linked certificate check site */
76  const char *cert_check_url; /* url "template for" checking a certificate */
77  const char *ca_certs; /* root certificates to use for connections */
78  apr_time_t min_delay; /* minimum delay for retries */
79  int retry_failover; /* number of errors to trigger CA failover */
80  int use_store_locks; /* use locks when updating store */
81  apr_time_t lock_wait_timeout; /* fail after this time when unable to obtain lock */
82  md_match_mode_t match_mode; /* how dns names are match to vhosts */
83 };
84 
85 typedef struct md_srv_conf_t {
86  const char *name;
87  const server_rec *s; /* server this config belongs to */
88  md_mod_conf_t *mc; /* global config settings */
89 
90  int transitive; /* != 0 iff VirtualHost names/aliases are auto-added */
91  md_require_t require_https; /* If MDs require https: access */
92  int renew_mode; /* mode of obtaining credentials */
93  int must_staple; /* certificates should set the OCSP Must Staple extension */
94  struct md_pkeys_spec_t *pks; /* specification for private keys */
95  md_timeslice_t *renew_window; /* time before expiration that starts renewal */
96  md_timeslice_t *warn_window; /* time before expiration that warning are sent out */
97 
98  struct apr_array_header_t *ca_urls; /* urls of CAs */
99  const char *ca_contact; /* contact email registered to account */
100  const char *ca_proto; /* protocol used vs CA (e.g. ACME) */
101  const char *ca_agreement; /* accepted agreement uri between CA and user */
102  struct apr_array_header_t *ca_challenges; /* challenge types configured */
103  const char *ca_eab_kid; /* != NULL, external account binding keyid */
104  const char *ca_eab_hmac; /* != NULL, external account binding hmac */
105 
106  int stapling; /* OCSP stapling enabled */
107  int staple_others; /* Provide OCSP stapling for non-MD certificates */
108 
109  const char *dns01_cmd; /* DNS challenge command, override global command */
110 
111  md_t *current; /* md currently defined in <MDomainSet xxx> section */
112  struct apr_array_header_t *assigned; /* post_config: MDs that apply to this server */
113  int is_ssl; /* SSLEngine is enabled here */
115 
117 void *md_config_merge_svr(apr_pool_t *pool, void *basev, void *addv);
118 
119 extern const command_rec md_cmds[];
120 
122 
123 /* Get the effective md configuration for the connection */
125 /* Get the effective md configuration for the server */
127 /* Get the effective md configuration for the server, but make it
128  * unique to this server_rec, so that any changes only affect this server */
130 
131 const char *md_config_gets(const md_srv_conf_t *config, md_config_var_t var);
133 
135 
136 const md_t *md_get_for_domain(server_rec *s, const char *domain);
137 
138 #endif /* md_config_h */
const char * s
Definition: mod_dav.h:1327
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
int apr_status_t
Definition: apr_errno.h:44
struct apr_hash_t apr_hash_t
Definition: apr_hash.h:52
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
struct apr_table_t apr_table_t
Definition: apr_tables.h:56
apr_int64_t apr_time_t
Definition: apr_time.h:45
md_require_t
Definition: md.h:61
struct md_ocsp_reg_t md_ocsp_reg_t
Definition: md_ocsp.h:36
struct md_reg_t md_reg_t
Definition: md_reg.h:33
const char * md_config_gets(const md_srv_conf_t *config, md_config_var_t var)
md_srv_conf_t * md_config_get_unique(server_rec *s, apr_pool_t *p)
md_srv_conf_t * md_config_get(server_rec *s)
void * md_config_create_svr(apr_pool_t *pool, server_rec *s)
int md_config_geti(const md_srv_conf_t *config, md_config_var_t var)
struct md_srv_conf_t md_srv_conf_t
md_config_var_t
Definition: mod_md_config.h:26
@ MD_CONFIG_MUST_STAPLE
Definition: mod_md_config.h:37
@ MD_CONFIG_BASE_DIR
Definition: mod_md_config.h:29
@ MD_CONFIG_CA_PROTO
Definition: mod_md_config.h:28
@ MD_CONFIG_RENEW_WINDOW
Definition: mod_md_config.h:32
@ MD_CONFIG_STAPLING
Definition: mod_md_config.h:40
@ MD_CONFIG_CA_AGREEMENT
Definition: mod_md_config.h:30
@ MD_CONFIG_STAPLE_OTHERS
Definition: mod_md_config.h:41
@ MD_CONFIG_REQUIRE_HTTPS
Definition: mod_md_config.h:36
@ MD_CONFIG_CA_CONTACT
Definition: mod_md_config.h:27
@ MD_CONFIG_TRANSITIVE
Definition: mod_md_config.h:34
@ MD_CONFIG_DRIVE_MODE
Definition: mod_md_config.h:31
@ MD_CONFIG_MESSGE_CMD
Definition: mod_md_config.h:39
@ MD_CONFIG_PROXY
Definition: mod_md_config.h:35
@ MD_CONFIG_NOTIFY_CMD
Definition: mod_md_config.h:38
@ MD_CONFIG_WARN_WINDOW
Definition: mod_md_config.h:33
md_match_mode_t
Definition: mod_md_config.h:44
@ MD_MATCH_SERVERNAMES
Definition: mod_md_config.h:46
@ MD_MATCH_ALL
Definition: mod_md_config.h:45
const command_rec md_cmds[]
md_srv_conf_t * md_config_cget(conn_rec *c)
void * md_config_merge_svr(apr_pool_t *pool, void *basev, void *addv)
void md_config_get_timespan(md_timeslice_t **pspan, const md_srv_conf_t *sc, md_config_var_t var)
const md_t * md_get_for_domain(server_rec *s, const char *domain)
apr_status_t md_config_post_config(server_rec *s, apr_pool_t *p)
Definition: apr_tables.h:62
Definition: http_config.h:204
Structure to store things which are per connection.
Definition: httpd.h:1193
Definition: mod_md_config.h:50
const char * cert_check_url
Definition: mod_md_config.h:76
struct apr_hash_t * init_errors
Definition: mod_md_config.h:65
md_timeslice_t * ocsp_keep_window
Definition: mod_md_config.h:73
apr_array_header_t * mds
Definition: mod_md_config.h:51
int local_80
Definition: mod_md_config.h:57
apr_time_t lock_wait_timeout
Definition: mod_md_config.h:81
const char * hsts_header
Definition: mod_md_config.h:63
int dry_run
Definition: mod_md_config.h:70
int manage_base_server
Definition: mod_md_config.h:61
int local_443
Definition: mod_md_config.h:58
const char * cert_check_name
Definition: mod_md_config.h:75
const char * proxy_url
Definition: mod_md_config.h:53
const char * notify_cmd
Definition: mod_md_config.h:67
int certificate_status_enabled
Definition: mod_md_config.h:72
const char * message_cmd
Definition: mod_md_config.h:68
int can_https
Definition: mod_md_config.h:60
struct apr_table_t * env
Definition: mod_md_config.h:69
int can_http
Definition: mod_md_config.h:59
int use_store_locks
Definition: mod_md_config.h:80
int hsts_max_age
Definition: mod_md_config.h:62
struct md_reg_t * reg
Definition: mod_md_config.h:54
int server_status_enabled
Definition: mod_md_config.h:71
const char * base_dir
Definition: mod_md_config.h:52
md_timeslice_t * ocsp_renew_window
Definition: mod_md_config.h:74
const char * ca_certs
Definition: mod_md_config.h:77
md_match_mode_t match_mode
Definition: mod_md_config.h:82
int retry_failover
Definition: mod_md_config.h:79
struct md_ocsp_reg_t * ocsp
Definition: mod_md_config.h:55
apr_time_t min_delay
Definition: mod_md_config.h:78
apr_array_header_t * unused_names
Definition: mod_md_config.h:64
Definition: md_crypt.h:71
Definition: mod_md_config.h:85
const char * ca_eab_kid
Definition: mod_md_config.h:103
int is_ssl
Definition: mod_md_config.h:113
md_timeslice_t * renew_window
Definition: mod_md_config.h:95
struct apr_array_header_t * ca_urls
Definition: mod_md_config.h:98
const char * dns01_cmd
Definition: mod_md_config.h:109
md_require_t require_https
Definition: mod_md_config.h:91
int stapling
Definition: mod_md_config.h:106
int must_staple
Definition: mod_md_config.h:93
struct apr_array_header_t * ca_challenges
Definition: mod_md_config.h:102
md_timeslice_t * warn_window
Definition: mod_md_config.h:96
struct apr_array_header_t * assigned
Definition: mod_md_config.h:112
const char * ca_contact
Definition: mod_md_config.h:99
const char * name
Definition: mod_md_config.h:86
int renew_mode
Definition: mod_md_config.h:92
int staple_others
Definition: mod_md_config.h:107
int transitive
Definition: mod_md_config.h:90
md_t * current
Definition: mod_md_config.h:111
const char * ca_eab_hmac
Definition: mod_md_config.h:104
const server_rec * s
Definition: mod_md_config.h:87
const char * ca_proto
Definition: mod_md_config.h:100
md_mod_conf_t * mc
Definition: mod_md_config.h:88
const char * ca_agreement
Definition: mod_md_config.h:101
struct md_pkeys_spec_t * pks
Definition: mod_md_config.h:94
Definition: md_store.h:325
Definition: md.h:76
Definition: md_time.h:60
A structure to store information for each virtual server.
Definition: httpd.h:1382
apr_pool_t * p