summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbeck <>2017-03-27 18:26:53 +0000
committerbeck <>2017-03-27 18:26:53 +0000
commitf1eb8de2723639aca0b0ee12614678932d45296b (patch)
tree6c40784f13a8a5dddb08d40a0b5f8deaa51011e1
parentf5d341368e261fbd1c9be50709d721e753d7a7b1 (diff)
downloadopenbsd-f1eb8de2723639aca0b0ee12614678932d45296b.tar.gz
openbsd-f1eb8de2723639aca0b0ee12614678932d45296b.tar.bz2
openbsd-f1eb8de2723639aca0b0ee12614678932d45296b.zip
use a path of "/" if the URL does not include a trailing / - since
the web server probably doesn't like it, even though you published the url without the trailing / in the certificate. (hello digicert!) ok claudio@
-rw-r--r--src/usr.sbin/ocspcheck/ocspcheck.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/usr.sbin/ocspcheck/ocspcheck.c b/src/usr.sbin/ocspcheck/ocspcheck.c
index 90a9143ee8..3917515f64 100644
--- a/src/usr.sbin/ocspcheck/ocspcheck.c
+++ b/src/usr.sbin/ocspcheck/ocspcheck.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocspcheck.c,v 1.18 2017/03/27 18:14:20 beck Exp $ */ 1/* $OpenBSD: ocspcheck.c,v 1.19 2017/03/27 18:26:53 beck Exp $ */
2/* 2/*
3 * Copyright (c) 2017 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2017 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -568,10 +568,13 @@ main(int argc, char **argv)
568 if ((request = ocsp_request_new_from_cert(certfile, nonce)) == NULL) 568 if ((request = ocsp_request_new_from_cert(certfile, nonce)) == NULL)
569 exit(1); 569 exit(1);
570 570
571 dspew("Built an %ld byte ocsp request\n", request->size);
572
571 if ((host = url2host(request->url, &port, &path)) == NULL) 573 if ((host = url2host(request->url, &port, &path)) == NULL)
572 errx(1, "Invalid OCSP url %s from %s", request->url, 574 errx(1, "Invalid OCSP url %s from %s", request->url,
573 certfile); 575 certfile);
574 dspew("Built an %ld byte ocsp request\n", request->size); 576 if (*path == '\0')
577 path = "/";
575 vspew("Using %s to host %s, port %d, path %s\n", 578 vspew("Using %s to host %s, port %d, path %s\n",
576 port == 443 ? "https" : "http", host, port, path); 579 port == 443 ? "https" : "http", host, port, path);
577 580