Skip to content

Instantly share code, notes, and snippets.

@koichik
Created August 9, 2011 11:55
Show Gist options
  • Select an option

  • Save koichik/1133842 to your computer and use it in GitHub Desktop.

Select an option

Save koichik/1133842 to your computer and use it in GitHub Desktop.

Revisions

  1. koichik revised this gist Aug 10, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ### tls.CleartextStream

    This is a stream on top of the *Encrypted* stream.
    それ (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.
    @@ -40,4 +40,4 @@ Example:
    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 has not been verified, it returns `null`
    If the peer does not provide a certificate, it returns `null` or an empty object.
  2. koichik revised this gist Aug 10, 2011. 1 changed file with 19 additions and 7 deletions.
    26 changes: 19 additions & 7 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -8,24 +8,36 @@ 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.
    A boolean that is `true` if the peer certificate was signed by one of the specified CAs, otherwise `false`

    #### cleartextStream.authorizationError

    The reason the peer's certificate has not been verified.
    This property exists only if `cleartextStream.authorized === false`.
    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 returning object has some properties corresponding to the field of the certificate.
    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',
    { 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 has not been verified, returns `null`
    If the peer has not been verified, it returns `null`
  3. koichik created this gist Aug 9, 2011.
    31 changes: 31 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,31 @@
    ### tls.CleartextStream

    This is a stream on top of the *Encrypted* stream.
    それ (Encrypted stream) の上で平文で読み書きできるって書きたいんだにょ。

    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.

    #### cleartextStream.authorizationError

    The reason the peer's certificate has not been verified.
    This property exists only if `cleartextStream.authorized === false`.

    #### cleartextStream.getPeerCertificate()

    Returns an object representing the peer's certicicate.
    The returning 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 has not been verified, returns `null`