{"record":{"id":"71bf51569a63ca8a","repo":"denoland/deno","slug":"err-tls-invalid-protocol-method","errorCode":"ERR_TLS_INVALID_PROTOCOL_METHOD","errorMessage":"SSLv2 methods disabled","messagePattern":"SSLv2 methods disabled","errorType":"error_code","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"ext/node/polyfills/_tls_common.ts","lineNumber":310,"sourceCode":"\n  if (options.secureProtocol) {\n    // If secureProtocol is set, minVersion/maxVersion must not also be set.\n    // Node raises this conflict before validating the protocol method string.\n    if (options.minVersion || options.maxVersion) {\n      throw new ERR_TLS_PROTOCOL_VERSION_CONFLICT(\n        options.minVersion || options.maxVersion,\n        \"secureProtocol\",\n      );\n    }\n\n    const range = kProtocolMap[options.secureProtocol];\n    if (!range) {\n      if (\n        options.secureProtocol === \"SSLv2_method\" ||\n        options.secureProtocol === \"SSLv2_client_method\" ||\n        options.secureProtocol === \"SSLv2_server_method\"\n      ) {\n        throw new ERR_TLS_INVALID_PROTOCOL_METHOD(\"SSLv2 methods disabled\");\n      }\n      if (\n        options.secureProtocol === \"SSLv3_method\" ||\n        options.secureProtocol === \"SSLv3_client_method\" ||\n        options.secureProtocol === \"SSLv3_server_method\"\n      ) {\n        throw new ERR_TLS_INVALID_PROTOCOL_METHOD(\"SSLv3 methods disabled\");\n      }\n      throw new ERR_TLS_INVALID_PROTOCOL_METHOD(\n        `Unknown method: ${options.secureProtocol}`,\n      );\n    }\n\n    minVersion = range[0];\n    maxVersion = range[1];\n  } else {\n    if (options.minVersion) {\n      if (!SetPrototypeHas(kValidVersions, options.minVersion)) {","sourceCodeStart":292,"sourceCodeEnd":328,"githubUrl":"https://github.com/denoland/deno/blob/9ad36f7a2cce60488e6ec52283efb32efddaf93a/ext/node/polyfills/_tls_common.ts#L292-L328","documentation":"ERR_TLS_INVALID_PROTOCOL_METHOD from _tls_common: secureProtocol strings selecting SSLv2 ('SSLv2_method', 'SSLv2_client_method', 'SSLv2_server_method') are recognized but permanently disabled — SSLv2 has been insecure for decades, so requesting it always throws 'SSLv2 methods disabled' rather than attempting any negotiation.","triggerScenarios":"tls.connect({ secureProtocol: 'SSLv2_method' }); https.createServer({ secureProtocol: 'SSLv2_server_method' }, handler);","commonSituations":"Ancient config files or 2000s-era vendor sample code; interoperability tests written against obsolete peers; hardcoded method lists that were never pruned during cleanups.","solutions":["Switch to secureProtocol: 'TLSv1_2_method' or, better, minVersion: 'TLSv1.2'","Remove the option entirely to use safe modern defaults","If a peer truly requires SSLv2, retire the peer — it cannot be supported"],"exampleFix":"// before\ntls.connect({ secureProtocol: 'SSLv2_method', host }); // throws\n\n// after\ntls.connect({ minVersion: 'TLSv1.2', maxVersion: 'TLSv1.3', host });","handlingStrategy":"validation","validationCode":"const DISABLED = [/^SSLv2_(client_|server_)?method$/, /^SSLv3_(client_|server_)?method$/];\nif (DISABLED.some((r) => r.test(opts.secureProtocol ?? ''))) {\n  throw new Error('SSLv2/SSLv3 are disabled; use minVersion/maxVersion');\n}","typeGuard":"const isSupportedSecureProtocol = (s) =>\n  /^(SSLv23|TLSv1|TLSv1_1|TLSv1_2)_(client_|server_)?method$/.test(s);","tryCatchPattern":null,"preventionTips":["Grep configs for 'SSLv' method strings during security reviews","Use version ranges (minVersion/maxVersion), not method selectors"],"tags":["tls","ssl","deprecated-protocol","security","node-compat"],"backgroundTag":"unsupported-tls-protocol-method","analyzedSha":"9ad36f7a2cce60488e6ec52283efb32efddaf93a","analyzedAt":"2026-08-20T13:07:44.778Z","contentChangedAt":"2026-08-20T13:07:44.778Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}