Node: Missing documentation for tls.parseCertString

Created on 12 Jul 2017  路  10Comments  路  Source: nodejs/node

  • Version: all as of v8.1.4
  • Platform: all
  • Subsystem: all


There is currently no documentation for tls.parseCertString

Since this function exported, I'd consider it part of the public API and therefore it should probably have some documentation explaining what it does.

doc tls

Most helpful comment

OK. I don't personally think we should document something only to remove it in the next major. If we do document it, it should be doc-deprecated at least.

All 10 comments

That function was exposed by accident more than anything else in commit af80e7b from 2013. It's probably better to move it to lib/internal than promote it to official API.

cc @indutny

@bnoordhuis Makes sense to me.

Also, after looking it what it actually does, it's also almost identical to calling

querystring.parse(str, '\n', '=')

with the one exception being when the string is invalid:

querystring.parse('invalidCertString', '\n', '=')
// yields {invalidCertString: ''} instead of {}

If we move it to internal, I think it's a semver major.

@chrisbroome did you call this API? for what purpose? It parses a format that doesn't appear to ever be produced by a public API, I don't see how it could be useful.

Calling it semver-major is safe, lets not doc, and move to internal for 9.x

I never actually used the API in production code. Basically I was playing around in the REPL exploring what was available in the tls module. I just typed tls.<tab>, saw parseCertString, and wanted to know what its purpose was (I thought maybe it was a function that let you extract information from base64-encoded .pem files). Anyway, I went to the documentation, but the function wasn't there, so I decided to open the issue.

OK. I don't personally think we should document something only to remove it in the next major. If we do document it, it should be doc-deprecated at least.

@sam-github I agree to remove it in the next major and document it now for deprecated.

I'd do the following:

  1. Don't document it.
  2. Move it to lib/internal and leave a stub function in lib/tls.js that prints a deprecation warning.
  3. In the next major or the one after that, remove the stub.

@bnoordhuis I've created another PR #14218 to move the function to internal.

Closing, #14249 was merged last year.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fanjunzhi picture fanjunzhi  路  3Comments

danielstaleiny picture danielstaleiny  路  3Comments

cong88 picture cong88  路  3Comments

jmichae3 picture jmichae3  路  3Comments

loretoparisi picture loretoparisi  路  3Comments