/* 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.
*/
/* * ssl.c --- routines for SSL/TLS server infrastructure. *
*/
staticint ssl_is_https(conn_rec *c)
{ /* Someone retrieved the optional function., not knowing about the
* new API. We redirect them to what they should have invoked. */ return ap_ssl_conn_is_ssl(c);
}
AP_DECLARE(int) ap_ssl_conn_is_ssl(conn_rec *c)
{ int r = (ap_run_ssl_conn_is_ssl(c) == OK); if (r == 0 && module_ssl_is_https) {
r = module_ssl_is_https(c);
} return r;
}
AP_DECLARE(int) ap_ssl_bind_outgoing(conn_rec *c, struct ap_conf_vector_t *dir_conf, int enable_ssl)
{ int rv, enabled = 0;
c->outgoing = 1;
rv = ap_run_ssl_bind_outgoing(c, dir_conf, enable_ssl);
enabled = (rv == OK); if (enable_ssl && !enabled) { /* the hooks did not take over. Is there an old skool optional that will? */ if (module_ssl_engine_set) {
enabled = module_ssl_engine_set(c, dir_conf, 1, 1);
} elseif (module_ssl_proxy_enable) {
enabled = module_ssl_proxy_enable(c);
}
} else { /* !enable_ssl || enabled
* any existing optional funcs need to not enable here */ if (module_ssl_engine_set) {
module_ssl_engine_set(c, dir_conf, 1, 0);
} elseif (module_ssl_engine_disable) {
module_ssl_engine_disable(c);
}
} if (enable_ssl && !enabled) {
ap_log_cerror(APLOG_MARK, APLOG_ERR, 0,
c, APLOGNO(01961) " failed to enable ssl support " "[Hint: if using mod_ssl, see SSLProxyEngine]"); return DECLINED;
} return OK;
}
staticconstchar *ssl_var_lookup(apr_pool_t *p, server_rec *s,
conn_rec *c, request_rec *r, constchar *name)
{ /* Someone retrieved the optional function., not knowing about the
* new API. We redirect them to what they should have invoked. */ return ap_ssl_var_lookup(p, s, c, r, name);
}
AP_DECLARE(void) ap_setup_ssl_optional_fns(apr_pool_t *pool)
{ /* Run as core's very early 'post config' hook, check for any already * installed optional functions related to SSL and save them. Install
* our own instances that invoke the new hooks. */
APR_OPTIONAL_FN_TYPE(ssl_is_https) *fn_is_https;
APR_OPTIONAL_FN_TYPE(ssl_var_lookup) *fn_ssl_var_lookup;
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.