-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
Use Case
"CERT_HAS_EXPIRED" has become the error message instead of "certificate has expired"
// 6.3.0 MongoServerSelectionError: certificate has expired at EventTarget.<anonymous> (./node_modules/mongodb-6.3.0/lib/sdam/topology.js:276:34) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20) at EventTarget.dispatchEvent (node:internal/event_target:761:26) at abortSignal (node:internal/abort_controller:371:10) at TimeoutController.abort (node:internal/abort_controller:393:5) at Timeout.<anonymous> (./node_modules/mongodb-6.3.0/lib/utils.js:1011:92) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7) { reason: TopologyDescription { type: 'Unknown', servers: Map(1) { 'expired.badssl.com:443' => [ServerDescription] }, stale: false, compatible: true, heartbeatFrequencyMS: 10000, localThresholdMS: 15, setName: null, maxElectionId: null, maxSetVersion: null, commonWireVersion: 0, logicalSessionTimeoutMinutes: null }, code: undefined, [Symbol(errorLabels)]: Set(0) {}, [cause]: MongoNetworkError: certificate has expired at connectionFailureError (./node_modules/mongodb-6.3.0/lib/cmap/connect.js:379:20) at TLSSocket.<anonymous> (./node_modules/mongodb-6.3.0/lib/cmap/connect.js:285:22) at Object.onceWrapper (node:events:633:26) at TLSSocket.emit (node:events:518:28) at emitErrorNT (node:internal/streams/destroy:169:8) at emitErrorCloseNT (node:internal/streams/destroy:128:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { [Symbol(errorLabels)]: Set(1) { 'ResetPool' }, [cause]: Error: certificate has expired at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34) at TLSSocket.emit (node:events:518:28) at TLSSocket._finishInit (node:_tls_wrap:1085:8) at ssl.onhandshakedone (node:_tls_wrap:871:12) { code: 'CERT_HAS_EXPIRED' } } } // 6.4.0 MongoServerSelectionError: CERT_HAS_EXPIRED at EventTarget.<anonymous> (./node_modules/mongodb-6.4.0/lib/sdam/topology.js:292:34) at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20) at EventTarget.dispatchEvent (node:internal/event_target:761:26) at abortSignal (node:internal/abort_controller:371:10) at TimeoutController.abort (node:internal/abort_controller:393:5) at Timeout.<anonymous> (./node_modules/mongodb-6.4.0/lib/utils.js:1008:92) at listOnTimeout (node:internal/timers:573:17) at process.processTimers (node:internal/timers:514:7) { reason: TopologyDescription { type: 'Unknown', servers: Map(1) { 'expired.badssl.com:443' => [ServerDescription] }, stale: false, compatible: true, heartbeatFrequencyMS: 10000, localThresholdMS: 15, setName: null, maxElectionId: null, maxSetVersion: null, commonWireVersion: 0, logicalSessionTimeoutMinutes: null }, code: undefined, [Symbol(errorLabels)]: Set(0) {}, [cause]: MongoError: CERT_HAS_EXPIRED at onHeartbeatFailed (./node_modules/mongodb-6.4.0/lib/sdam/monitor.js:172:15) at ./node_modules/mongodb-6.4.0/lib/sdam/monitor.js:265:9 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { [Symbol(errorLabels)]: Set(1) { 'ResetPool' }, [cause]: 'CERT_HAS_EXPIRED' } }
User Impact
- Devtools, potentially external users
Dependencies
- connect(), socket creation error handling
Unknowns
- How is a string being treated as a cause?
Acceptance Criteria
Implementation Requirements
- Ensure the message is in a helpful readable format
Testing Requirements
- Use the host below to check the message
require("mongodb-6.4.0").MongoClient.connect("mongodb://expired.badssl.com:443/?tls=true&serverSelectionTimeoutMS=1000").catch(err => console.log(err))
Documentation Requirements
- None
Follow Up Requirements
- None
- depends on
-
NODE-5192 Wrap socket.authorizationError in connect.ts with a MongoError subclass
- Closed
- is depended on by
-
MONGOSH-1728 Update bson and mongodb to ^6.4.1
- Closed