| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f7be6ab commit 807c7e1
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1595,6 +1595,9 @@ Type: End-of-Life | |||
| 1595 | 1595 | ||
| 1596 | 1596 | <!-- YAML | |
| 1597 | 1597 | changes: | |
| 1598 | + - version: REPLACEME | ||
| 1599 | + pr-url: https://github.com/nodejs/node/pull/41479 | ||
| 1600 | + description: End-of-Life. | ||
| 1598 | 1601 | - version: v9.0.0 | |
| 1599 | 1602 | pr-url: https://github.com/nodejs/node/pull/14249 | |
| 1600 | 1603 | description: Runtime deprecation. | |
@@ -1603,25 +1606,15 @@ changes: | |||
| 1603 | 1606 | description: Documentation-only deprecation. | |
| 1604 | 1607 | --> | |
| 1605 | 1608 | ||
| 1606 | - Type: Runtime | ||
| 1607 | - | ||
| 1608 | - `tls.parseCertString()` is a trivial parsing helper that was made public by | ||
| 1609 | - mistake. This function can usually be replaced with: | ||
| 1610 | - | ||
| 1611 | - ```js | ||
| 1612 | - const querystring = require('querystring'); | ||
| 1613 | - querystring.parse(str, '\n', '='); | ||
| 1614 | - ``` | ||
| 1609 | + Type: End-of-Life | ||
| 1615 | 1610 | ||
| 1616 | - This function is not completely equivalent to `querystring.parse()`. One | ||
| 1617 | - difference is that `querystring.parse()` does url decoding: | ||
| 1611 | + `tls.parseCertString()` was a trivial parsing helper that was made public by | ||
| 1612 | + mistake. While it was supposed to parse certificate subject and issuer strings, | ||
| 1613 | + it never handled multi-value Relative Distinguished Names correctly. | ||
| 1618 | 1614 | ||
| 1619 | - ```console | ||
| 1620 | - > querystring.parse('%E5%A5%BD=1', '\n', '='); | ||
| 1621 | - { '好': '1' } | ||
| 1622 | - > tls.parseCertString('%E5%A5%BD=1'); | ||
| 1623 | - { '%E5%A5%BD': '1' } | ||
| 1624 | - ``` | ||
| 1615 | + Earlier versions of this document suggested using `querystring.parse()` as an | ||
| 1616 | + alternative to `tls.parseCertString()`. However, `querystring.parse()` also does | ||
| 1617 | + not handle all certificate subjects correctly and should not be used. | ||
| 1625 | 1618 | ||
| 1626 | 1619 | ### DEP0077: `Module._debug()` | |
| 1627 | 1620 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,10 +55,6 @@ const { | |||
| 55 | 55 | configSecureContext, | |
| 56 | 56 | } = require('internal/tls/secure-context'); | |
| 57 | 57 | ||
| 58 | - const { | ||
| 59 | - parseCertString, | ||
| 60 | - } = require('internal/tls/parse-cert-string'); | ||
| 61 | - | ||
| 62 | 58 | function toV(which, v, def) { | |
| 63 | 59 | if (v == null) v = def; | |
| 64 | 60 | if (v === 'TLSv1') return TLS1_VERSION; | |
@@ -126,13 +122,9 @@ function translatePeerCertificate(c) { | |||
| 126 | 122 | if (!c) | |
| 127 | 123 | return null; | |
| 128 | 124 | ||
| 129 | - // TODO(tniessen): can we remove parseCertString without breaking anything? | ||
| 130 | - if (typeof c.issuer === 'string') c.issuer = parseCertString(c.issuer); | ||
| 131 | 125 | if (c.issuerCertificate != null && c.issuerCertificate !== c) { | |
| 132 | 126 | c.issuerCertificate = translatePeerCertificate(c.issuerCertificate); | |
| 133 | 127 | } | |
| 134 | - // TODO(tniessen): can we remove parseCertString without breaking anything? | ||
| 135 | - if (typeof c.subject === 'string') c.subject = parseCertString(c.subject); | ||
| 136 | 128 | if (c.infoAccess != null) { | |
| 137 | 129 | const info = c.infoAccess; | |
| 138 | 130 | c.infoAccess = ObjectCreate(null); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,7 +64,6 @@ const { canonicalizeIP } = internalBinding('cares_wrap'); | |||
| 64 | 64 | const _tls_common = require('_tls_common'); | |
| 65 | 65 | const _tls_wrap = require('_tls_wrap'); | |
| 66 | 66 | const { createSecurePair } = require('internal/tls/secure-pair'); | |
| 67 | - const { parseCertString } = require('internal/tls/parse-cert-string'); | ||
| 68 | 67 | ||
| 69 | 68 | // Allow {CLIENT_RENEG_LIMIT} client-initiated session renegotiations | |
| 70 | 69 | // every {CLIENT_RENEG_WINDOW} seconds. An error event is emitted if more | |
@@ -338,12 +337,6 @@ exports.Server = _tls_wrap.Server; | |||
| 338 | 337 | exports.createServer = _tls_wrap.createServer; | |
| 339 | 338 | exports.connect = _tls_wrap.connect; | |
| 340 | 339 | ||
| 341 | - exports.parseCertString = internalUtil.deprecate( | ||
| 342 | - parseCertString, | ||
| 343 | - 'tls.parseCertString() is deprecated. ' + | ||
| 344 | - 'Please use querystring.parse() instead.', | ||
| 345 | - 'DEP0076'); | ||
| 346 | - | ||
| 347 | 340 | exports.createSecurePair = internalUtil.deprecate( | |
| 348 | 341 | createSecurePair, | |
| 349 | 342 | 'tls.createSecurePair() is deprecated. Please use ' + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,11 +9,6 @@ const { strictEqual, deepStrictEqual } = require('assert'); | |||
| 9 | 9 | const { translatePeerCertificate } = require('_tls_common'); | |
| 10 | 10 | ||
| 11 | 11 | const certString = '__proto__=42\nA=1\nB=2\nC=3'; | |
| 12 | - const certObject = Object.create(null); | ||
| 13 | - certObject.__proto__ = '42'; | ||
| 14 | - certObject.A = '1'; | ||
| 15 | - certObject.B = '2'; | ||
| 16 | - certObject.C = '3'; | ||
| 17 | 12 | ||
| 18 | 13 | strictEqual(translatePeerCertificate(null), null); | |
| 19 | 14 | strictEqual(translatePeerCertificate(undefined), null); | |
@@ -23,27 +18,33 @@ strictEqual(translatePeerCertificate(1), 1); | |||
| 23 | 18 | ||
| 24 | 19 | deepStrictEqual(translatePeerCertificate({}), {}); | |
| 25 | 20 | ||
| 21 | + // Earlier versions of Node.js parsed the issuer property but did so | ||
| 22 | + // incorrectly. This behavior has now reached end-of-life and user-supplied | ||
| 23 | + // strings will not be parsed at all. | ||
| 26 | 24 | deepStrictEqual(translatePeerCertificate({ issuer: '' }), | |
| 27 | - { issuer: Object.create(null) }); | ||
| 25 | + { issuer: '' }); | ||
| 28 | 26 | deepStrictEqual(translatePeerCertificate({ issuer: null }), | |
| 29 | 27 | { issuer: null }); | |
| 30 | 28 | deepStrictEqual(translatePeerCertificate({ issuer: certString }), | |
| 31 | - { issuer: certObject }); | ||
| 29 | + { issuer: certString }); | ||
| 32 | 30 | ||
| 31 | + // Earlier versions of Node.js parsed the issuer property but did so | ||
| 32 | + // incorrectly. This behavior has now reached end-of-life and user-supplied | ||
| 33 | + // strings will not be parsed at all. | ||
| 33 | 34 | deepStrictEqual(translatePeerCertificate({ subject: '' }), | |
| 34 | - { subject: Object.create(null) }); | ||
| 35 | + { subject: '' }); | ||
| 35 | 36 | deepStrictEqual(translatePeerCertificate({ subject: null }), | |
| 36 | 37 | { subject: null }); | |
| 37 | 38 | deepStrictEqual(translatePeerCertificate({ subject: certString }), | |
| 38 | - { subject: certObject }); | ||
| 39 | + { subject: certString }); | ||
| 39 | 40 | ||
| 40 | 41 | deepStrictEqual(translatePeerCertificate({ issuerCertificate: '' }), | |
| 41 | 42 | { issuerCertificate: null }); | |
| 42 | 43 | deepStrictEqual(translatePeerCertificate({ issuerCertificate: null }), | |
| 43 | 44 | { issuerCertificate: null }); | |
| 44 | 45 | deepStrictEqual( | |
| 45 | 46 | translatePeerCertificate({ issuerCertificate: { subject: certString } }), | |
| 46 | - { issuerCertificate: { subject: certObject } }); | ||
| 47 | + { issuerCertificate: { subject: certString } }); | ||
| 47 | 48 | ||
| 48 | 49 | { | |
| 49 | 50 | const cert = {}; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments