@@ -82,7 +82,6 @@ static md_mod_conf_t defmc = {
8282 & def_ocsp_renew_window , /* default time to renew ocsp responses */
8383 "crt.sh" , /* default cert checker site name */
8484 "https://crt.sh?q=" , /* default cert checker site url */
85- NULL , /* CA cert file to use */
8685 APR_TIME_C (0 ), /* initial cert check delay */
8786 apr_time_from_sec (MD_SECS_PER_DAY /2 ), /* default time between cert checks */
8887 apr_time_from_sec (30 ), /* minimum delay for retries */
@@ -127,6 +126,7 @@ static md_srv_conf_t defconf = {
127126 1 , /* ACME ARI renewals */
128127 NULL , /* dns01_cmd */
129128 NULL , /* proxy URL */
129+ NULL , /* CA cert file to use */
130130 NULL , /* currently defined md */
131131 NULL , /* assigned md, post config */
132132 0 , /* is_ssl, set during mod_ssl post_config */
@@ -186,6 +186,7 @@ static void srv_conf_props_clear(md_srv_conf_t *sc)
186186 sc -> ari_renewals = DEF_VAL ;
187187 sc -> dns01_cmd = NULL ;
188188 sc -> proxy_url = NULL ;
189+ sc -> ca_certs = NULL ;
189190}
190191
191192static void srv_conf_props_copy (md_srv_conf_t * to , const md_srv_conf_t * from )
@@ -211,6 +212,7 @@ static void srv_conf_props_copy(md_srv_conf_t *to, const md_srv_conf_t *from)
211212 to -> ari_renewals = from -> ari_renewals ;
212213 to -> dns01_cmd = from -> dns01_cmd ;
213214 to -> proxy_url = from -> proxy_url ;
215+ to -> ca_certs = from -> ca_certs ;
214216}
215217
216218static void srv_conf_props_apply (md_t * md , const md_srv_conf_t * from , apr_pool_t * p )
@@ -239,6 +241,7 @@ static void srv_conf_props_apply(md_t *md, const md_srv_conf_t *from, apr_pool_t
239241 if (from -> stapling != DEF_VAL ) md -> stapling = from -> stapling ;
240242 if (from -> dns01_cmd ) md -> dns01_cmd = from -> dns01_cmd ;
241243 if (from -> proxy_url ) md -> proxy_url = from -> proxy_url ;
244+ if (from -> ca_certs ) md -> ca_certs = from -> ca_certs ;
242245}
243246
244247void * md_config_create_svr (apr_pool_t * pool , server_rec * s )
@@ -289,6 +292,7 @@ static void *md_config_merge(apr_pool_t *pool, void *basev, void *addv)
289292 nsc -> ari_renewals = (add -> ari_renewals != DEF_VAL )? add -> ari_renewals : base -> ari_renewals ;
290293 nsc -> dns01_cmd = (add -> dns01_cmd )? add -> dns01_cmd : base -> dns01_cmd ;
291294 nsc -> proxy_url = (add -> proxy_url )? add -> proxy_url : base -> proxy_url ;
295+ nsc -> ca_certs = (add -> ca_certs )? add -> ca_certs : base -> ca_certs ;
292296 nsc -> current = NULL ;
293297
294298 return nsc ;
@@ -1250,12 +1254,22 @@ static const char *md_config_set_activation_delay(cmd_parms *cmd, void *mconfig,
12501254 return NULL ;
12511255}
12521256
1253- static const char * md_config_set_ca_certs (cmd_parms * cmd , void * dc , const char * path )
1257+ static const char * md_config_set_ca_certs (cmd_parms * cmd , void * arg , const char * value )
12541258{
12551259 md_srv_conf_t * sc = md_config_get (cmd -> server );
1260+ const char * err ;
12561261
1257- (void )dc ;
1258- sc -> mc -> ca_certs = path ;
1262+ if ((err = md_conf_check_location (cmd , MD_LOC_ALL ))) {
1263+ return err ;
1264+ }
1265+
1266+ if (inside_md_section (cmd )) {
1267+ sc -> ca_certs = value ;
1268+ } else {
1269+ apr_table_set (sc -> mc -> env , MD_KEY_CA_CERTS , value );
1270+ }
1271+
1272+ (void )arg ;
12591273 return NULL ;
12601274}
12611275
0 commit comments