szmarczak / http-timer

🕐 Performance timings for HTTP requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Supress invalid SSL certificate errors

corford opened this issue · comments

Does http-timer respect https.rejectUnauthorized=false ? It seems from below that "unable to verify the first certificate" errors can still bubble up despite https.rejectUnauthorized being set to false.

RequestError: unable to verify the first certificate
      at ClientRequest.<anonymous> (/opt/dcsfw/node_modules/@apify/http-request/node_modules/got/dist/source/core/index.js:826:25)
      at Object.onceWrapper (events.js:422:26)
      at ClientRequest.emit (events.js:327:22)
      at ClientRequest.EventEmitter.emit (domain.js:485:12)
      at ClientRequest.origin.emit (/opt/dcsfw/node_modules/@apify/http-request/node_modules/@szmarczak/http-timer/dist/source/index.js:39:20)
      at TLSSocket.socketErrorListener (_http_client.js:432:9)
      at TLSSocket.emit (events.js:315:20)
      at TLSSocket.EventEmitter.emit (domain.js:485:12)
      at emitErrorNT (internal/streams/destroy.js:84:8)
      at processTicksAndRejections (internal/process/task_queues.js:84:21)
      at TLSSocket.onConnectSecure (_tls_wrap.js:1498:34)
      at TLSSocket.emit (events.js:315:20)
      at TLSSocket.EventEmitter.emit (domain.js:485:12)
      at TLSSocket._finishInit (_tls_wrap.js:940:8)
      at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:698:12)

Using Got 11.2.0 and http-timer 4.0.5

Confirmed to be caused by an issue in the calling code, not http-timer or Got. Apologies.