diff options
author | Jack Lloyd <[email protected]> | 2017-12-16 14:09:01 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-12-17 14:59:21 -0500 |
commit | db192f099e7cae79c391e2cec3ec26436093dcb1 (patch) | |
tree | decce824516e8e4aa9cac9e47523cbb953a03be5 /src/lib/x509/ocsp.cpp | |
parent | 3679787e87482f96164f1fab4320d9ecacf1c6b9 (diff) |
Expose timeouts on the freestanding OCSP request utils
Diffstat (limited to 'src/lib/x509/ocsp.cpp')
-rw-r--r-- | src/lib/x509/ocsp.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/x509/ocsp.cpp b/src/lib/x509/ocsp.cpp index cf0c1064b..6d8d66687 100644 --- a/src/lib/x509/ocsp.cpp +++ b/src/lib/x509/ocsp.cpp @@ -283,7 +283,8 @@ Certificate_Status_Code Response::status_for(const X509_Certificate& issuer, Response online_check(const X509_Certificate& issuer, const BigInt& subject_serial, const std::string& ocsp_responder, - Certificate_Store* trusted_roots) + Certificate_Store* trusted_roots, + std::chrono::milliseconds timeout) { if(ocsp_responder.empty()) throw Invalid_Argument("No OCSP responder specified"); @@ -292,7 +293,9 @@ Response online_check(const X509_Certificate& issuer, auto http = HTTP::POST_sync(ocsp_responder, "application/ocsp-request", - req.BER_encode()); + req.BER_encode(), + 1, + timeout); http.throw_unless_ok(); @@ -312,7 +315,8 @@ Response online_check(const X509_Certificate& issuer, Response online_check(const X509_Certificate& issuer, const X509_Certificate& subject, - Certificate_Store* trusted_roots) + Certificate_Store* trusted_roots, + std::chrono::milliseconds timeout) { if(subject.issuer_dn() != issuer.subject_dn()) throw Invalid_Argument("Invalid cert pair to OCSP::online_check (mismatched issuer,subject args?)"); @@ -320,7 +324,8 @@ Response online_check(const X509_Certificate& issuer, return online_check(issuer, BigInt::decode(subject.serial_number()), subject.ocsp_responder(), - trusted_roots); + trusted_roots, + timeout); } #endif |