MCPcopy Create free account
hub / github.com/apache/httpd / ssl_cmd_SSLStaplingCache

Function ssl_cmd_SSLStaplingCache

modules/ssl/ssl_engine_config.c:1952–2005  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1950#ifdef HAVE_OCSP_STAPLING
1951
1952const char *ssl_cmd_SSLStaplingCache(cmd_parms *cmd,
1953 void *dcfg,
1954 const char *arg)
1955{
1956 SSLModConfigRec *mc = myModConfig(cmd->server);
1957 const char *err, *sep, *name;
1958
1959 if ((err = ap_check_cmd_context(cmd, GLOBAL_ONLY))) {
1960 return err;
1961 }
1962
1963 /* Argument is of form 'name:args' or just 'name'. */
1964 sep = ap_strchr_c(arg, ':');
1965 if (sep) {
1966 name = apr_pstrmemdup(cmd->pool, arg, sep - arg);
1967 sep++;
1968 }
1969 else {
1970 name = arg;
1971 }
1972
1973 /* Find the provider of given name. */
1974 mc->stapling_cache = ap_lookup_provider(AP_SOCACHE_PROVIDER_GROUP,
1975 name,
1976 AP_SOCACHE_PROVIDER_VERSION);
1977 if (mc->stapling_cache) {
1978 /* Cache found; create it, passing anything beyond the colon. */
1979 err = mc->stapling_cache->create(&mc->stapling_cache_context,
1980 sep, cmd->temp_pool,
1981 cmd->pool);
1982 }
1983 else {
1984 apr_array_header_t *name_list;
1985 const char *all_names;
1986
1987 /* Build a comma-separated list of all registered provider
1988 * names: */
1989 name_list = ap_list_provider_names(cmd->pool,
1990 AP_SOCACHE_PROVIDER_GROUP,
1991 AP_SOCACHE_PROVIDER_VERSION);
1992 all_names = apr_array_pstrcat(cmd->pool, name_list, ',');
1993
1994 err = apr_psprintf(cmd->pool, "'%s' stapling cache not supported "
1995 "(known names: %s) Maybe you need to load the "
1996 "appropriate socache module (mod_socache_%s?)",
1997 name, all_names, name);
1998 }
1999
2000 if (err) {
2001 return apr_psprintf(cmd->pool, "SSLStaplingCache: %s", err);
2002 }
2003
2004 return NULL;
2005}
2006
2007const char *ssl_cmd_SSLUseStapling(cmd_parms *cmd, void *dcfg, int flag)
2008{

Callers

nothing calls this directly

Calls 4

ap_check_cmd_contextFunction · 0.85
ap_strchr_cFunction · 0.85
ap_lookup_providerFunction · 0.85
ap_list_provider_namesFunction · 0.85

Tested by

no test coverage detected