| 927 | } |
| 928 | |
| 929 | apr_status_t modssl_init_stapling(server_rec *s, apr_pool_t *p, |
| 930 | apr_pool_t *ptemp, modssl_ctx_t *mctx) |
| 931 | { |
| 932 | SSL_CTX *ctx = mctx->ssl_ctx; |
| 933 | SSLModConfigRec *mc = myModConfig(s); |
| 934 | |
| 935 | if (mc->stapling_cache == NULL) { |
| 936 | ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01958) |
| 937 | "SSLStapling: no stapling cache available"); |
| 938 | return ssl_die(s); |
| 939 | } |
| 940 | if (ssl_stapling_mutex_init(s, ptemp) == FALSE) { |
| 941 | ap_log_error(APLOG_MARK, APLOG_EMERG, 0, s, APLOGNO(01959) |
| 942 | "SSLStapling: cannot initialise stapling mutex"); |
| 943 | return ssl_die(s); |
| 944 | } |
| 945 | /* Set some default values for parameters if they are not set */ |
| 946 | if (mctx->stapling_resptime_skew == UNSET) { |
| 947 | mctx->stapling_resptime_skew = 60 * 5; |
| 948 | } |
| 949 | if (mctx->stapling_cache_timeout == UNSET) { |
| 950 | mctx->stapling_cache_timeout = 3600; |
| 951 | } |
| 952 | if (mctx->stapling_return_errors == UNSET) { |
| 953 | mctx->stapling_return_errors = TRUE; |
| 954 | } |
| 955 | if (mctx->stapling_fake_trylater == UNSET) { |
| 956 | mctx->stapling_fake_trylater = TRUE; |
| 957 | } |
| 958 | if (mctx->stapling_errcache_timeout == UNSET) { |
| 959 | mctx->stapling_errcache_timeout = 600; |
| 960 | } |
| 961 | if (mctx->stapling_responder_timeout == UNSET) { |
| 962 | mctx->stapling_responder_timeout = 10 * APR_USEC_PER_SEC; |
| 963 | } |
| 964 | |
| 965 | SSL_CTX_set_tlsext_status_cb(ctx, stapling_cb); |
| 966 | ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, s, APLOGNO(01960) "OCSP stapling initialized"); |
| 967 | |
| 968 | return APR_SUCCESS; |
| 969 | } |
| 970 | |
| 971 | #endif |
no test coverage detected