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

Function detect_supported_protocols

modules/md/mod_md.c:437–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437static apr_status_t detect_supported_protocols(md_mod_conf_t *mc, server_rec *s,
438 apr_pool_t *p, int log_level)
439{
440 ap_listen_rec *lr;
441 apr_sockaddr_t *sa;
442 int can_http, can_https;
443
444 if (mc->can_http >= 0 && mc->can_https >= 0) goto set_and_leave;
445
446 can_http = can_https = 0;
447 for (lr = ap_listeners; lr; lr = lr->next) {
448 for (sa = lr->bind_addr; sa; sa = sa->next) {
449 if (sa->port == mc->local_80
450 && (!lr->protocol || !strncmp("http", lr->protocol, 4))) {
451 can_http = 1;
452 }
453 else if (sa->port == mc->local_443
454 && (!lr->protocol || !strncmp("http", lr->protocol, 4))) {
455 can_https = 1;
456 }
457 }
458 }
459 if (mc->can_http < 0) mc->can_http = can_http;
460 if (mc->can_https < 0) mc->can_https = can_https;
461 ap_log_error(APLOG_MARK, log_level, 0, s, APLOGNO(10037)
462 "server seems%s reachable via http: and%s reachable via https:",
463 mc->can_http? "" : " not", mc->can_https? "" : " not");
464set_and_leave:
465 return md_reg_set_props(mc->reg, p, mc->can_http, mc->can_https);
466}
467
468static server_rec *get_public_https_server(md_t *md, const char *domain, server_rec *base_server)
469{

Callers 1

Calls 2

md_reg_set_propsFunction · 0.85
ap_log_errorFunction · 0.50

Tested by

no test coverage detected