40#define SSL_MOD_CONFIG_KEY "ssl_module"
70#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ENGINE_INIT)
73#ifdef HAVE_OCSP_STAPLING
75 mc->stapling_cache_mutex =
NULL;
76 mc->stapling_refresh_mutex =
NULL;
79#ifdef HAVE_OPENSSL_KEYLOG
109#ifdef HAVE_SSL_CONF_CMD
126#ifdef HAVE_TLS_SESSION_TICKETS
131 mctx->protocol_set = 0;
161 mctx->ocsp_verify_flags = 0;
165#ifdef HAVE_OCSP_STAPLING
173 mctx->stapling_responder_timeout =
UNSET;
182#ifdef HAVE_SSL_CONF_CMD
212#ifdef HAVE_TLS_SESSION_TICKETS
231#ifndef OPENSSL_NO_COMP
253#define cfgMerge(el,unset) mrg->el = (add->el == (unset)) ? base->el : add->el
254#define cfgMergeArray(el) mrg->el = apr_array_append(p, base->el, add->el)
255#define cfgMergeString(el) cfgMerge(el, NULL)
256#define cfgMergeBool(el) cfgMerge(el, UNSET)
257#define cfgMergeInt(el) cfgMerge(el, UNSET)
269 mrg->protocol_set = 1;
273 mrg->protocol_set =
base->protocol_set;
274 mrg->protocol =
base->protocol;
307#ifdef HAVE_OCSP_STAPLING
324#ifdef HAVE_SSL_CONF_CMD
376 mrg->pks->cert_files);
379 mrg->pks->key_files);
384#ifdef HAVE_TLS_SESSION_TICKETS
403#ifndef OPENSSL_NO_COMP
493 (
base->nOptions & ~(
mrg->nOptionsDel)) |
mrg->nOptionsAdd;
510 if (!
mrg->proxy_post_config) {
571 "Invalid SSLPassPhraseDialog exec: path ",
579 "SSLPassPhraseDialog: file '",
581 "' does not exist",
NULL);
585 else if ((
arglen > 1) && (
arg[0] ==
'|')) {
590 return "SSLPassPhraseDialog: Invalid argument";
602#if MODSSL_HAVE_ENGINE_API
611 mc->szCryptoDevice =
NULL;
613#if MODSSL_HAVE_ENGINE_API
615 mc->szCryptoDevice =
arg;
620 err =
"SSLCryptoDevice: Invalid argument; must be one of: "
622#if MODSSL_HAVE_ENGINE_API
667 "invalid context: `",
arg1,
"'",
684 return apr_pstrcat(
cmd->pool,
"Invalid SSLRandomSeed entropy source `",
686 " does not support the Entropy Gathering Daemon "
702 "Invalid SSLRandomSeed path ",
707 "SSLRandomSeed: source path '",
717 return "SSLRandomSeed: byte specification not "
718 "allowed for builtin seed source";
724 return "SSLRandomSeed: invalid number of bytes specified";
748 return "Argument must be On, Off, or Optional";
764 return "Conflicting SSLFIPS options, cannot be both On and Off";
768 return "SSLFIPS invalid, rebuild httpd and openssl compiled for FIPS";
797#if SSL_HAVE_PROTOCOL_TLSV1_3
800 return "TLSv1.3 ciphers cannot be set inside a directory context";
809#define SSL_FLAGS_CHECK_FILE \
810 (SSL_PCM_EXISTS|SSL_PCM_ISREG|SSL_PCM_ISNONZERO)
812#define SSL_FLAGS_CHECK_DIR \
813 (SSL_PCM_EXISTS|SSL_PCM_ISDIR)
828 ": Invalid file path ", *
file,
NULL);
838 "' does not exist or is empty",
NULL);
844#if !defined(OPENSSL_NO_COMP)
846#ifndef SSL_OP_NO_COMPRESSION
849 return "This version of OpenSSL does not support enabling "
850 "SSLCompression within <VirtualHost> sections.";
859 return "This version of OpenSSL does not have any compression methods "
860 "available, cannot enable SSLCompression.";
866 return "Setting Compression mode unsupported; not implemented by the SSL library";
874#ifdef SSL_OP_CIPHER_SERVER_PREFERENCE
879 return "SSLHonorCipherOrder unsupported; not implemented by the SSL library";
886#ifndef SSL_OP_NO_TICKET
887 return "This version of OpenSSL does not support using "
888 "SSLSessionTickets.";
896#ifdef SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
901 return "The SSLInsecureRenegotiation directive is not available "
902 "with this SSL library";
914 ": Invalid dir path ", *
dir,
NULL);
923 ": directory '", *
dir,
924 "' does not exist",
NULL);
980#ifdef HAVE_TLS_SESSION_TICKETS
998#define NO_PER_DIR_SSL_CA \
999 "Your SSL library does not have support for per-directory CA"
1117 else if (
strcEQ(w,
"leaf")) {
1120 else if (
strcEQ(w,
"chain")) {
1125 ": Invalid argument '", w,
"'",
1131 if (
strcEQ(w,
"no_crl_for_cert_ok")) {
1136 ": Invalid argument '", w,
"'",
1166 else if (
strcEQ(
arg,
"optional_no_ca")) {
1171 ": Invalid argument '",
arg,
"'",
1205 if ((*depth =
atoi(
arg)) >= 0) {
1210 ": Invalid argument '",
arg,
"'",
1282 if (
mc->sesscache) {
1285 err =
mc->sesscache->create(&
mc->sesscache_context,
sep,
1286 cmd->temp_pool,
cmd->pool);
1300 "(known names: %s). Maybe you need to load the "
1301 "appropriate socache module (mod_socache_%s?).",
1322 return "SSLSessionCacheTimeout: Invalid argument";
1341 if ((*w ==
'+') || (*w ==
'-')) {
1349 if (
strcEQ(w,
"StdEnvVars")) {
1352 else if (
strcEQ(w,
"ExportCertData")) {
1355 else if (
strcEQ(w,
"FakeBasicAuth")) {
1358 else if (
strcEQ(w,
"StrictRequire")) {
1361 else if (
strcEQ(w,
"OptRenegotiate")) {
1364 else if (
strcEQ(w,
"LegacyDNStringFormat")) {
1369 "SSLOptions: Illegal option '", w,
"'",
1373 if (action ==
'-') {
1378 else if (action ==
'+') {
1412 info->filename =
cmd->directive->filename;
1413 info->line_number =
cmd->directive->line_num;
1434 return apr_pstrcat(
cmd->pool,
"Invalid size for SSLRenegBufferSize: ",
1454 if ((*w ==
'+') || (*w ==
'-')) {
1458 if (
strcEQ(w,
"SSLv2")) {
1459 if (action ==
'-') {
1463 return "SSLProtocol: SSLv2 is no longer supported";
1466 else if (
strcEQ(w,
"SSLv3")) {
1467#ifdef OPENSSL_NO_SSL3
1468 if (action !=
'-') {
1469 return "SSLv3 not supported by this version of OpenSSL";
1477 else if (
strcEQ(w,
"TLSv1")) {
1481 else if (
strcEQ(w,
"TLSv1.1")) {
1484 else if (
strcEQ(w,
"TLSv1.2")) {
1491 else if (
strcEQ(w,
"all")) {
1497 ": Illegal protocol '", w,
"'",
NULL);
1500 if (action ==
'-') {
1503 else if (action ==
'+') {
1509 "%s: Protocol '%s' overrides already set parameter(s). "
1510 "Check if a +/- prefix is missing.",
1511 parms->cmd->name, w);
1551 const char *
arg1,
const char *
arg2)
1566#if SSL_HAVE_PROTOCOL_TLSV1_3
1748 else if (
strcEQ(w,
"leaf")) {
1751 else if (
strcEQ(w,
"on")) {
1756 ": Invalid argument '", w,
"'",
1762 if (
strcEQ(w,
"no_ocsp_for_cert_ok")) {
1767 ": Invalid argument '", w,
"'",
1779#ifdef OPENSSL_NO_OCSP
1781 return "OCSP support disabled in SSL library; cannot enable "
1812 return "SSLOCSPResponseTimeSkew: invalid argument";
1822 return "SSLOCSPResponseMaxAge: invalid argument";
1832 return "SSLOCSPResponderTimeout: invalid argument";
1853 "SSLOCSPProxyURL: Cannot parse URL %s",
arg);
1904 return "SSLStrictSNIVHostCheck failed; OpenSSL is not built with support "
1905 "for TLS extensions and SNI indication. Refer to the "
1906 "documentation, and build a compatible version of OpenSSL.";
1910#ifdef HAVE_OCSP_STAPLING
1937 if (
mc->stapling_cache) {
1939 err =
mc->stapling_cache->create(&
mc->stapling_cache_context,
1955 "(known names: %s) Maybe you need to load the "
1956 "appropriate socache module (mod_socache_%s?)",
1979 if (sc->
server->stapling_resptime_skew < 0) {
1980 return "SSLStaplingResponseTimeSkew: invalid argument";
1990 if (sc->
server->stapling_resp_maxage < 0) {
1991 return "SSLStaplingResponseMaxAge: invalid argument";
2001 if (sc->
server->stapling_cache_timeout < 0) {
2002 return "SSLStaplingStandardCacheTimeout: invalid argument";
2012 if (sc->
server->stapling_errcache_timeout < 0) {
2013 return "SSLStaplingErrorCacheTimeout: invalid argument";
2040 if (sc->
server->stapling_responder_timeout < 0) {
2041 return "SSLStaplingResponderTimeout: invalid argument";
2056#ifdef HAVE_SSL_CONF_CMD
2058 const char *
arg1,
const char *
arg2)
2068 "'%s': invalid OpenSSL configuration command",
static apr_pool_t * pconf
char * ap_server_root_relative(apr_pool_t *p, const char *fname)
#define AP_SQ_RM_CONFIG_DUMP
int ap_exists_config_define(const char *name)
int ap_state_query(int query_code)
#define APLOG_MODULE_INDEX
apr_array_header_t * ap_list_provider_names(apr_pool_t *pool, const char *provider_group, const char *provider_version)
void * ap_lookup_provider(const char *provider_group, const char *provider_name, const char *provider_version)
apr_brigade_flush void * ctx
apr_dbd_transaction_t int mode
#define AP_EXPR_FLAG_SSL_EXPR_COMPAT
const char * ap_expr_parse(apr_pool_t *pool, apr_pool_t *ptemp, ap_expr_info_t *info, const char *expr, ap_expr_lookup_fn_t *lookup_fn)
#define AP_SOCACHE_PROVIDER_GROUP
#define AP_SOCACHE_PROVIDER_VERSION
const char * ssl_cmd_SSLCADNRequestFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyVerify(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCACertificateFile(cmd_parms *cmd, void *dcfg, const char *arg)
int modssl_is_engine_id(const char *name)
const char * ssl_cmd_SSLOCSPResponseMaxAge(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCertificateFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOCSPUseRequestNonce(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLVerifyDepth(cmd_parms *cmd, void *dcfg, const char *arg)
#define SSL_OPT_OPTRENEGOTIATE
unsigned int ssl_util_path_check(ssl_pathcheck_t, const char *, apr_pool_t *)
const char * ssl_cmd_SSLProxyCARevocationPath(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLInsecureRenegotiation(cmd_parms *cmd, void *dcfg, int flag)
SSLModConfigRec * ssl_config_global_create(server_rec *s)
void * ssl_config_perdir_merge(apr_pool_t *p, void *basev, void *addv)
const char * ssl_cmd_SSLProxyCipherSuite(cmd_parms *cmd, void *dcfg, const char *arg1, const char *arg2)
const char * ssl_cmd_SSLSessionCache(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLVerifyClient(cmd_parms *cmd, void *dcfg, const char *arg)
#define SSL_PROTOCOL_DEFAULT
#define SSL_OPT_STRICTREQUIRE
const char * ssl_cmd_SSLRandomSeed(cmd_parms *cmd, void *dcfg, const char *arg1, const char *arg2, const char *arg3)
const char * ssl_cmd_SSLCARevocationFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOCSPResponseTimeSkew(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyMachineCertificateFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCARevocationCheck(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCertificateChainFile(cmd_parms *cmd, void *dcfg, const char *arg)
#define SSL_PROTOCOL_TLSV1
const char * ssl_cmd_SSLRequire(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOCSPOverrideResponder(cmd_parms *cmd, void *dcfg, int flag)
void * ssl_config_server_create(apr_pool_t *p, server_rec *s)
const char * ssl_cmd_SSLProxyMachineCertificateChainFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyCheckPeerCN(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLProxyCACertificateFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyMachineCertificatePath(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyCheckPeerExpire(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLSessionCacheTimeout(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOCSPResponderTimeout(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyCACertificatePath(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLSessionTickets(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLProxyCARevocationCheck(cmd_parms *cmd, void *dcfg, const char *arg)
void ssl_config_proxy_merge(apr_pool_t *p, SSLDirConfigRec *base, SSLDirConfigRec *conf)
const char * ssl_cmd_SSLRenegBufferSize(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyEngine(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLOCSPNoVerify(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLHonorCipherOrder(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLOCSPDefaultResponder(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCertificateKeyFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLRequireSSL(cmd_parms *cmd, void *dcfg)
const char * ssl_cmd_SSLCompression(cmd_parms *cmd, void *dcfg, int flag)
void * ssl_config_perdir_create(apr_pool_t *p, char *dir)
const char * ssl_cmd_SSLCARevocationPath(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLPassPhraseDialog(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyVerifyDepth(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyProtocol(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOCSPEnable(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProtocol(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCACertificatePath(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLProxyCheckPeerName(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLFIPS(cmd_parms *cmd, void *dcfg, int flag)
#define SSL_OPT_LEGACYDNFORMAT
#define SSL_OPT_STDENVVARS
const char * ssl_cmd_SSLUserName(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLEngine(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCADNRequestPath(cmd_parms *cmd, void *dcfg, const char *arg)
#define SSL_OPT_EXPORTCERTDATA
const char * ssl_cmd_SSLCryptoDevice(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOptions(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLOCSPProxyURL(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLCipherSuite(cmd_parms *cmd, void *dcfg, const char *arg1, const char *arg2)
const char * ssl_cmd_SSLOCSPResponderCertificateFile(cmd_parms *cmd, void *dcfg, const char *arg)
const char * ssl_cmd_SSLStrictSNIVHostCheck(cmd_parms *cmd, void *dcfg, int flag)
const char * ssl_cmd_SSLProxyCARevocationFile(cmd_parms *cmd, void *dcfg, const char *arg)
#define SSL_PROTOCOL_NONE
void * ssl_config_server_merge(apr_pool_t *p, void *basev, void *addv)
unsigned int ssl_config_global_isfixed(SSLModConfigRec *mc)
#define SSL_PROTOCOL_SSLV3
#define SSL_OPT_FAKEBASICAUTH
void ssl_hook_ConfigTest(apr_pool_t *pconf, server_rec *s)
void ssl_config_global_fix(SSLModConfigRec *mc)
@ SSL_OCSPCHECK_NO_OCSP_FOR_CERT_OK
@ SSL_CVERIFY_OPTIONAL_NO_CA
@ SSL_CRLCHECK_NO_CRL_FOR_CERT_OK
#define MODSSL_LIBRARY_NAME
#define ap_strchr_c(s, c)
char * ap_getword_conf(apr_pool_t *p, const char **line)
const char * ap_check_cmd_context(cmd_parms *cmd, unsigned forbidden)
const char int apr_pool_t * pool
const char apr_int32_t flag
const char apr_file_t * file
int strcasecmp(const char *a, const char *b)
#define apr_pcalloc(p, size)
#define APR_ARRAY_PUSH(ary, type)
#define APR_ARRAY_IDX(ary, i, type)
const apr_array_header_t * first
apr_int32_t apr_int32_t apr_int32_t err
#define apr_time_from_sec(sec)
#define strEQn(s1, s2, n)
static const char * ssl_cmd_verify_depth_parse(cmd_parms *parms, const char *arg, int *depth)
#define SSL_MOD_CONFIG_KEY
#define SSL_FLAGS_CHECK_FILE
static SSLSrvConfigRec * ssl_config_server_new(apr_pool_t *p)
#define cfgMergeString(el)
#define cfgMerge(el, unset)
#define cfgMergeArray(el)
static void modssl_ctx_cfg_merge_proxy(apr_pool_t *p, modssl_ctx_t *base, modssl_ctx_t *add, modssl_ctx_t *mrg)
static void modssl_ctx_init_proxy(SSLDirConfigRec *dc, apr_pool_t *p)
static const char * ssl_cmd_verify_parse(cmd_parms *parms, const char *arg, ssl_verify_t *id)
static void modssl_ctx_init(modssl_ctx_t *mctx, apr_pool_t *p)
static void modssl_ctx_cfg_merge_server(apr_pool_t *p, modssl_ctx_t *base, modssl_ctx_t *add, modssl_ctx_t *mrg)
static void modssl_ctx_cfg_merge_certkeys_array(apr_pool_t *p, apr_array_header_t *base, apr_array_header_t *add, apr_array_header_t *mrg)
static const char * ssl_cmd_crlcheck_parse(cmd_parms *parms, const char *arg, int *mask)
static const char * ssl_cmd_protocol_parse(cmd_parms *parms, const char *arg, ssl_proto_t *options)
static const char * ssl_cmd_check_dir(cmd_parms *parms, const char **dir)
#define NO_PER_DIR_SSL_CA
static void modssl_ctx_init_server(SSLSrvConfigRec *sc, apr_pool_t *p)
static const char * ssl_cmd_check_file(cmd_parms *parms, const char **file)
static const char * ssl_cmd_ocspcheck_parse(cmd_parms *parms, const char *arg, int *mask)
#define SSL_FLAGS_CHECK_DIR
static void modssl_ctx_cfg_merge(apr_pool_t *p, modssl_ctx_t *base, modssl_ctx_t *add, modssl_ctx_t *mrg)
Internal interfaces private to mod_ssl.
unsigned int proxy_enabled
unsigned int bSSLRequired
ssl_verify_t nVerifyClient
unsigned int proxy_post_config
const char * szCipherSuite
apr_size_t nRenegBufferSize
apr_array_header_t * aRequirement
unsigned int cipher_server_pref
unsigned int session_tickets
int session_cache_timeout
unsigned int insecure_reneg
const char * cipher_suite
const char * ca_cert_file
const char * ca_cert_path
const char * tls13_ciphers
ssl_pphrase_t pphrase_dialog_type
const char * ocsp_responder
unsigned int ocsp_noverify
unsigned int ocsp_use_request_nonce
unsigned int ssl_check_peer_cn
const char * pphrase_dialog_path
unsigned int ssl_check_peer_expire
const char * ocsp_certs_file
unsigned int ocsp_force_default
unsigned int ssl_check_peer_name
apr_interval_time_t ocsp_responder_timeout
const char * ca_cert_file
apr_array_header_t * key_files
apr_array_header_t * cert_files
const char * ca_name_path
const char * ca_name_file
A structure to store information for each virtual server.
Apache Mutex support library.