Skip to content

Abort OCSP requests when the response times out #455

Description

@TorinAsakura

Problem

An OCSP responder can send headers or part of the body, then stop responding. After 30 seconds, response.buffer() rejects, but the underlying request is not aborted and its socket can stay open.

SignedDataVerifier.checkOCSPStatus uses node-fetch's timeout: 30000. That option aborts a request waiting for headers, but does not abort the request when reading the body times out. The body read also sits outside the network-error handler, so the public verification methods return VERIFICATION_FAILURE instead of RETRYABLE_VERIFICATION_FAILURE.

This affects version 3.1.0 and main at bb0c0f874494321ea2d005329c3dc2188e893d41.

Expected behavior

Apply one 30-second deadline to the request and the complete response body. When it expires, abort the request, close the connection and return RETRYABLE_VERIFICATION_FAILURE.

Non-timeout response-body and OCSP validation errors should keep their current classification.

Related work

#345 introduced the OCSP timeout and retryable network-error status. #424 and #425 concern the App Store Server API client; they do not cover the OCSP request in SignedDataVerifier.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions