/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.
*/
/* Minimum age for the HSTS header (RFC 6797), considered appropriate by Mozilla Security */ #define MD_HSTS_HEADER "Strict-Transport-Security" #define MD_HSTS_MAX_AGE_DEFAULT 15768000
typedefenum {
MD_S_UNKNOWN = 0, /* MD has not been analysed yet */
MD_S_INCOMPLETE = 1, /* MD is missing necessary information, cannot go live */
MD_S_COMPLETE = 2, /* MD has all necessary information, can go live */
MD_S_EXPIRED_DEPRECATED = 3, /* deprecated */
MD_S_ERROR = 4, /* MD data is flawed, unable to be processed as is */
MD_S_MISSING_INFORMATION = 5, /* User has not agreed to ToS */
} md_state_t;
typedefenum {
MD_RENEW_DEFAULT = -1, /* default value */
MD_RENEW_MANUAL, /* manually triggered renewal of certificate */
MD_RENEW_AUTO, /* automatic process performed by httpd */
MD_RENEW_ALWAYS, /* always renewed by httpd, even if not necessary */
} md_renew_mode_t;
typedefstruct md_t md_t; struct md_t { constchar *name; /* unique name of this MD */ struct apr_array_header_t *domains; /* all DNS names this MD includes */ struct apr_array_header_t *contacts; /* list of contact uris, e.g. mailto:xxx */
struct md_pkeys_spec_t *pks; /* specification for generating private keys */
md_timeslice_t *renew_window; /* time before expiration that starts renewal */
md_timeslice_t *warn_window; /* time before expiration that warnings are sent out */
constchar *ca_proto; /* protocol used vs CA (e.g. ACME) */ struct apr_array_header_t *ca_urls; /* urls of CAs */ constchar *ca_effective; /* url of CA used */ constchar *ca_account; /* account used at CA */ constchar *ca_agreement; /* accepted agreement uri between CA and user */ struct apr_array_header_t *ca_challenges; /* challenge types configured for this MD */ struct apr_array_header_t *cert_files; /* != NULL iff pubcerts explicitly configured */ struct apr_array_header_t *pkey_files; /* != NULL iff privkeys explicitly configured */ constchar *ca_eab_kid; /* optional KEYID for external account binding */ constchar *ca_eab_hmac; /* optional HMAC for external account binding */ constchar *profile; /* optional cert profile to order */ int profile_mandatory; /* if profile, when given, is mandatory */
constchar *state_descr; /* description of state of NULL */
struct apr_array_header_t *acme_tls_1_domains; /* domains supporting "acme-tls/1" protocol */ constchar *dns01_cmd; /* DNS challenge command, override global command */
conststruct md_srv_conf_t *sc; /* server config where it was defined or NULL */ constchar *defn_name; /* config file this MD was defined */ unsigned defn_line_number; /* line number of definition */ constchar *configured_name; /* name this MD was configured with, if different */
int renew_mode; /* mode of obtaining credentials */
md_require_t require_https; /* Iff https: is required for this MD */
md_state_t state; /* state of this MD */ int transitive; /* != 0 iff VirtualHost names/aliases are auto-added */ int must_staple; /* certificates should set the OCSP Must Staple extension */ int stapling; /* if OCSP stapling is enabled */ int watched; /* if certificate is supervised (renew or expiration warning) */
};
/* Check if a string member of a new MD (n) has * a value and if it differs from the old MD o
*/ #define MD_VAL_UPDATE(n,o,s) ((n)->s != (o)->s) #define MD_SVAL_UPDATE(n,o,s) ((n)->s && (!(o)->s || strcmp((n)->s, (o)->s)))
/** * Determine if the Managed Domain contains a specific domain name.
*/ int md_contains(const md_t *md, constchar *domain, int case_sensitive);
/** * Determine if the names of the two managed domains overlap.
*/ int md_domains_overlap(const md_t *md1, const md_t *md2);
/** * Determine if the domain names are equal.
*/ int md_equal_domains(const md_t *md1, const md_t *md2, int case_sensitive);
/** * Determine if the domains in md1 contain all domains of md2.
*/ int md_contains_domains(const md_t *md1, const md_t *md2);
/** * Get one common domain name of the two managed domains or NULL.
*/ constchar *md_common_name(const md_t *md1, const md_t *md2);
/** * Get the number of common domains.
*/
apr_size_t md_common_name_count(const md_t *md1, const md_t *md2);
/** * Look up a managed domain by its name.
*/
md_t *md_get_by_name(struct apr_array_header_t *mds, constchar *name);
/** * Look up a managed domain by a DNS name it contains.
*/
md_t *md_get_by_domain(struct apr_array_header_t *mds, constchar *domain);
/** * Find a managed domain, different from the given one, that has overlaps * in the domain list.
*/
md_t *md_get_by_dns_overlap(struct apr_array_header_t *mds, const md_t *md);
/** * Create a managed domain, given a list of domain names.
*/
md_t *md_create(apr_pool_t *p, struct apr_array_header_t *domains);
/** * Deep copy an md record into another pool.
*/
md_t *md_clone(apr_pool_t *p, const md_t *src);
/** * Shallow copy an md record into another pool.
*/
md_t *md_copy(apr_pool_t *p, const md_t *src);
/** * Convert the managed domain into a JSON representation and vice versa. * * This reads and writes the following information: name, domains, ca_url, ca_proto and state.
*/ struct md_json_t *md_to_json(const md_t *md, apr_pool_t *p);
md_t *md_from_json(struct md_json_t *json, apr_pool_t *p);
/** * Same as md_to_json(), but with sensitive fields stripped.
*/ struct md_json_t *md_to_public_json(const md_t *md, apr_pool_t *p);
int md_is_covered_by_alt_names(const md_t *md, conststruct apr_array_header_t* alt_names);
/* how many certificates this domain has/will eventually have. */ int md_cert_count(const md_t *md);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.