Commit 4c5c535b authored by Joe Orton's avatar Joe Orton
Browse files

Relax checks for OCSP responder URIs:

* modules/ssl/ssl_engine_ocsp.c (determine_responder_uri): Allow
  NULL path; use default port for given schem.

* modules/ssl/ssl_util_ocsp.c (serialize_request): Use / if no path
  specified.

Submitted by: Kaspar Brand <asfbugz velox.ch>
PR: 45522


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@683242 13f79535-47bb-0310-9956-ffa450edef68
parent 9d283cf2
Loading
Loading
Loading
Loading
+5 −1
Changes for modules/ssl/ssl_engine_ocsp.c: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ static apr_uri_t *determine_responder_uri(SSLSrvConfigRec *sc, X509 *cert,
    }

    rv = apr_uri_parse(p, s, u);
    if (rv || !u->hostname || !u->path) {    
    if (rv || !u->hostname) {    
        ap_log_cerror(APLOG_MARK, APLOG_DEBUG, rv, c, 
                      "failed to parse OCSP responder URI '%s'", s);
        return NULL;
@@ -92,6 +92,10 @@ static apr_uri_t *determine_responder_uri(SSLSrvConfigRec *sc, X509 *cert,
        return NULL;
    }

    if (!u->port) {
        u->port = apr_uri_port_of_scheme(u->scheme);
    }

    return u;
}

+2 −1
Changes for modules/ssl/ssl_util_ocsp.c: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -40,7 +40,8 @@ static BIO *serialize_request(OCSP_REQUEST *req, const apr_uri_t *uri)
               "Host: %s:%d\r\n"
               "Content-Length: %d\r\n"
               "\r\n", 
               uri->path, uri->query ? "?" : "", uri->query ? uri->query : "",
               uri->path ? uri->path : "/",
               uri->query ? "?" : "", uri->query ? uri->query : "",
               uri->hostname, uri->port, len);

    if (i2d_OCSP_REQUEST_bio(bio, req) != 1) {