49#ifdef HAVE_OCSP_STAPLING
63#define MAX_STAPLING_DER 10240
101#ifdef OPENSSL_NO_SSL_INTERN
110#if OPENSSL_VERSION_NUMBER < 0x10100000L
150 if (
mctx->stapling_enabled ==
TRUE) {
152 "ssl_stapling_init_cert: can't retrieve issuer "
172 if (
mctx->stapling_enabled !=
TRUE) {
179 if (
mctx->stapling_enabled !=
TRUE) {
191 if (!
cinf->uri && !
mctx->stapling_force_url) {
193 APLOGNO(02814)
"ssl_stapling_init_cert: no OCSP URI "
194 "in certificate and no SSLStaplingForceURL "
195 "configured for server %s",
mctx->sc->vhost_id);
204 "ssl_stapling_init_cert: can't create CertID "
211 if (!
aia && !
mctx->stapling_force_url) {
214 APLOGNO(02218)
"ssl_stapling_init_cert: no OCSP URI "
215 "in certificate and no SSLStaplingForceURL set");
234 "ssl_stapling_init_cert: storing certinfo for server %s",
252 "stapling_get_certinfo: stapling not supported for certificate");
281 "OCSP stapling response encode error??");
288 "OCSP stapling response too big (%u bytes)",
resp_derlen);
310 rv =
mc->stapling_cache->store(
mc->stapling_cache_context,
s,
317 "stapling_cache_response: OCSP response session store error!");
332 const unsigned char *
p;
337 rv =
mc->stapling_cache->retrieve(
mc->stapling_cache_context,
s,
344 "stapling_get_cached_response: cache miss");
352 "stapling_get_cached_response: response length invalid??");
365 "stapling_get_cached_response: response parse error??");
369 "stapling_get_cached_response: cache hit");
404 if (
mctx->stapling_return_errors)
414 "stapling_check_response: Error Parsing Response!");
422 "stapling_check_response: certificate ID not present in response!");
423 if (
mctx->stapling_return_errors ==
FALSE)
428 mctx->stapling_resptime_skew,
429 mctx->stapling_resp_maxage)) {
440 "stapling_check_response: response times invalid");
444 "stapling_check_response: cached response expired");
465 "stapling_check_response: response has certificate "
466 "status %s (reason: %s) for serial number %s",
496 "stapling_renew_response: querying responder");
515 if (
mctx->stapling_force_url)
522 "stapling_renew_response: no uri for responder");
533 "stapling_renew_response: Error parsing uri %s",
540 "stapling_renew_response: Unsupported uri %s",
ocspuri);
556 "stapling_renew_response: responder error");
557 if (
mctx->stapling_fake_trylater) {
569 "stapling_renew_response: query response received");
573 "stapling_renew_response: error in retrieved response!");
578 "stapling_renew_response: responder error %s",
585 "stapling_renew_response: error caching response!");
610 if (
mc->stapling_refresh_mutex || sc->
server->stapling_enabled !=
TRUE) {
645 "Cannot reinit %s mutex with file `%s'",
650 "Cannot reinit %s mutex",
type);
661 if (
mc->stapling_cache_mutex !=
NULL
667 if (
mc->stapling_refresh_mutex !=
NULL
683 "Failed to acquire OCSP %s lock",
name);
696 "Failed to release OCSP %s lock",
name);
749 "stapling_cb: retrieved cached response");
769 else if (!
mctx->stapling_return_errors) {
820 "stapling_cb: OCSP Stapling callback called");
851 "stapling_cb: OCSP Stapling disabled");
860 "stapling_cb: retrieved cached certificate data");
869 "stapling_cb: renewing cached response");
878 "stapling_cb: error checking for cached response "
879 "after obtaining refresh mutex");
885 "stapling_cb: don't need to refresh cached response "
886 "after obtaining refresh mutex");
891 "stapling_cb: still must refresh cached response "
892 "after obtaining refresh mutex");
899 "stapling_cb: success renewing response");
903 "stapling_cb: fatal error renewing response");
911 "stapling_cb: setting response");
921 "stapling_cb: no suitable response available");
935 if (
mc->stapling_cache ==
NULL) {
937 "SSLStapling: no stapling cache available");
942 "SSLStapling: cannot initialise stapling mutex");
946 if (
mctx->stapling_resptime_skew ==
UNSET) {
947 mctx->stapling_resptime_skew = 60 * 5;
949 if (
mctx->stapling_cache_timeout ==
UNSET) {
950 mctx->stapling_cache_timeout = 3600;
952 if (
mctx->stapling_return_errors ==
UNSET) {
953 mctx->stapling_return_errors =
TRUE;
955 if (
mctx->stapling_fake_trylater ==
UNSET) {
956 mctx->stapling_fake_trylater =
TRUE;
958 if (
mctx->stapling_errcache_timeout ==
UNSET) {
959 mctx->stapling_errcache_timeout = 600;
961 if (
mctx->stapling_responder_timeout ==
UNSET) {
Apache Multi-Processing Module library.
const char apr_size_t len
APR Thread Mutex Routines.
apr_status_t ap_global_mutex_create(apr_global_mutex_t **mutex, const char **name, const char *type, const char *instance_id, server_rec *server, apr_pool_t *pool, apr_int32_t options)
apr_status_t ap_ssl_ocsp_get_resp(server_rec *s, conn_rec *c, const char *id, apr_size_t id_len, ap_ssl_ocsp_copy_resp *cb, void *userdata)
apr_status_t ap_ssl_ocsp_prime(server_rec *s, apr_pool_t *p, const char *id, apr_size_t id_len, const char *pem)
apr_brigade_flush void * ctx
#define APR_IMPLEMENT_OPTIONAL_HOOK_RUN_ALL(ns, link, ret, name, args_decl, args_use, ok, decline)
#define AP_SOCACHE_FLAG_NOTMPSAFE
apr_status_t ssl_die(server_rec *s)
OCSP_RESPONSE * modssl_dispatch_ocsp_request(const apr_uri_t *uri, apr_interval_time_t timeout, OCSP_REQUEST *request, conn_rec *c, apr_pool_t *p)
#define SSL_STAPLING_REFRESH_MUTEX_TYPE
int ssl_stapling_mutex_reinit(server_rec *, apr_pool_t *)
#define myConnCtxConfig(c, sc)
#define SSL_STAPLING_CACHE_MUTEX_TYPE
apr_status_t modssl_cert_get_pem(apr_pool_t *p, X509 *cert1, X509 *cert2, const char **ppem)
int ssl_run_get_stapling_status(unsigned char **pder, int *pderlen, conn_rec *c, server_rec *s, X509 *cert)
int ssl_run_init_stapling_status(server_rec *s, apr_pool_t *p, X509 *cert, X509 *issuer)
#define AP_DEBUG_ASSERT(exp)
const char int apr_pool_t * pool
void const char apr_status_t(* cleanup)(void *))
apr_vformatter_buff_t * c
#define apr_pool_create(newpool, parent)
#define apr_pcalloc(p, size)
apr_int32_t apr_int32_t apr_int32_t err
#define apr_time_from_sec(sec)
void ssl_log_xerror(const char *file, int line, int level, apr_status_t rv, apr_pool_t *ptemp, server_rec *s, X509 *cert, const char *fmt,...)
Internal interfaces private to mod_ssl.
Structure to store things which are per connection.
A structure to store information for each virtual server.