Created
August 9, 2011 11:55
-
-
Save koichik/1133842 to your computer and use it in GitHub Desktop.
tls.markdown
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### tls.CleartextStream | |
This is a stream on top of the *Encrypted* stream. | |
This makes it possible to read/write an encrypted data as a cleartext data. | |
This instance implements a duplex Stream interfaces. | |
It has all the common stream methods and events. | |
#### cleartextStream.authorized | |
A boolean that is `true` if the peer certificate was signed by one of the specified CAs, otherwise `false` | |
#### cleartextStream.authorizationError | |
The reason why the peer's certificate has not been verified. | |
This property becomes available only when `cleartextStream.authorized === false`. | |
#### cleartextStream.getPeerCertificate() | |
Returns an object representing the peer's certicicate. | |
The returned object has some properties corresponding to the field of the certificate. | |
Example: | |
{ subject: | |
{ C: 'UK', | |
ST: 'Acknack Ltd', | |
L: 'Rhys Jones', | |
O: 'node.js', | |
OU: 'Test TLS Certificate', | |
CN: 'localhost' }, | |
issuer: | |
{ C: 'UK', | |
ST: 'Acknack Ltd', | |
L: 'Rhys Jones', | |
O: 'node.js', | |
OU: 'Test TLS Certificate', | |
CN: 'localhost' }, | |
valid_from: 'Nov 11 09:52:22 2009 GMT', | |
valid_to: 'Nov 6 09:52:22 2029 GMT', | |
fingerprint: '2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF' } | |
If the peer does not provide a certificate, it returns `null` or an empty object. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
この文章自体は良いと思いますが、どういう時にtrueじゃないのかもあったほうがいいと思います。
A boolean that is
true
if the peer certificate was signed by one of the specified CAs, otherwisefalse
. とかですかね。大きく問題はありませんが、私なら
The reason why the peer's certificate has not been verified.
This property becomes available only when
cleartextStream.authorized === false
.とかかな。
The returned objectの方がいいかもです。
最後のところが、it returns
null
. の方がはっきりするかもです。いずれにしても、私の修正なしでも全然通じますよ!