New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
General improvements to HTTPS API #1255
General improvements to HTTPS API #1255
Conversation
With this PR I also wanted to add the documentation described in #1191 |
2 out of the 3 current HTTPS test are broken, the first 2 make plain HTTP requests. You should have used |
Could you fix that please? 🙏 |
Yeah, I'm working on it |
I was working on a test for const tls = require('tls');
tls.connect({
host: '127.0.0.1',
port: 49637,
checkServerIdentity: (hostname, certificate) => {
// This is never called for localhost addresses
}
}) Of course there's no documentation by Node.JS, there's only a comment in an example: // Necessary only if the server's cert isn't for "localhost".
checkServerIdentity: () => { return null; }, I've to keep in mind this when writing the documentation, also the test need to be performed using an external service, we can use https://badssl.com/ |
Maybe there's a |
Or maybe try setting |
I've tried all of them, same result |
I made a mistake, it seems that |
Added some HTTPS tests Changed `PeerCertificate` to `DetailedPeerCertificate`
checkServerIdentity
to Options
While For example My idea would be to add an HTTPS section to the documentation. |
I agree. |
This is a first draft of the HTTPS documentation, there're some other parameter. The params that I've included there are the most used. Since |
Co-authored-by: Szymon Marczak <36894700+szmarczak@users.noreply.github.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
@sindresorhus If you want to have different names (from the tls module) for the properties related to HTTPS I think that |
Co-authored-by: Szymon Marczak <36894700+szmarczak@users.noreply.github.com>
"Deprecation Warning" tests must be serial or else they'll steal each other |
Co-authored-by: Szymon Marczak <36894700+szmarczak@users.noreply.github.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
There are a few more unresolved inline comments. |
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
Sorry, I missed them, I was watching only the "Conversation" tab on Github. |
This looks great now. Thanks for your hard work on this 🙌 |
Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com> Co-authored-by: Szymon Marczak <36894700+szmarczak@users.noreply.github.com>
Checklist
Fixes #1254
checkServerIdentity
signature:According to DefinitelyTyped
certificate
isPeerCertificate
, but after testing I discovered that certificate has the propertyissuerCertificate
that's mean it'sDetailedPeerCertificate
I can't find any documentation about using this property with
https.Request
on Node.JS, I think this is a side effect of the implementation ofhttps.Request
. But, on the Node.JS documentation there's an example using it "Example pinning on certificate fingerprint, or the public key (similar to pin-sha256)"Node.JS even have a test about it:
https://github.com/nodejs/node/blob/8b4af64f50c5e41ce0155716f294c24ccdecad03/test/parallel/test-https-client-checkServerIdentity.js