{
  "source": "doc/api/tls.markdown",
  "modules": [
    {
      "textRaw": "TLS (SSL)",
      "name": "tls_(ssl)",
      "stability": 3,
      "stabilityText": "Stable",
      "desc": "<p>Use <code>require(&#39;tls&#39;)</code> to access this module.\n\n</p>\n<p>The <code>tls</code> module uses OpenSSL to provide Transport Layer Security and/or\nSecure Socket Layer: encrypted stream communication.\n\n</p>\n<p>TLS/SSL is a public/private key infrastructure. Each client and each\nserver must have a private key. A private key is created like this:\n\n</p>\n<pre><code>openssl genrsa -out ryans-key.pem 2048</code></pre>\n<p>All servers and some clients need to have a certificate. Certificates are public\nkeys signed by a Certificate Authority or self-signed. The first step to\ngetting a certificate is to create a &quot;Certificate Signing Request&quot; (CSR)\nfile. This is done with:\n\n</p>\n<pre><code>openssl req -new -sha256 -key ryans-key.pem -out ryans-csr.pem</code></pre>\n<p>To create a self-signed certificate with the CSR, do this:\n\n</p>\n<pre><code>openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem</code></pre>\n<p>Alternatively you can send the CSR to a Certificate Authority for signing.\n\n</p>\n<p>(TODO: docs on creating a CA, for now interested users should just look at\n<code>test/fixtures/keys/Makefile</code> in the Node source code)\n\n</p>\n<p>To create .pfx or .p12, do this:\n\n</p>\n<pre><code>openssl pkcs12 -export -in agent5-cert.pem -inkey agent5-key.pem \\\n    -certfile ca-cert.pem -out agent5.pfx</code></pre>\n<ul>\n<li><code>in</code>:  certificate</li>\n<li><code>inkey</code>: private key</li>\n<li><code>certfile</code>: all CA certs concatenated in one file like\n<code>cat ca1-cert.pem ca2-cert.pem &gt; ca-cert.pem</code></li>\n</ul>\n",
      "modules": [
        {
          "textRaw": "Protocol support",
          "name": "protocol_support",
          "desc": "<p>Node.js is compiled with SSLv2 and SSLv3 protocol support by default, but these\nprotocols are <strong>disabled</strong>. They are considered insecure and could be easily\ncompromised as was shown by [CVE-2014-3566][]. However, in some situations, it\nmay cause problems with legacy clients/servers (such as Internet Explorer 6).\nIf you wish to enable SSLv2 or SSLv3, run node with the <code>--enable-ssl2</code> or\n<code>--enable-ssl3</code> flag respectively.  In future versions of Node.js SSLv2 and\nSSLv3 will not be compiled in by default.\n\n</p>\n<p>There is a way to force node into using SSLv3 or SSLv2 only mode by explicitly\nspecifying <code>secureProtocol</code> to <code>&#39;SSLv3_method&#39;</code> or <code>&#39;SSLv2_method&#39;</code>.\n\n</p>\n<p>The default protocol method Node.js uses is <code>SSLv23_method</code> which would be more\naccurately named <code>AutoNegotiate_method</code>. This method will try and negotiate\nfrom the highest level down to whatever the client supports.  To provide a\nsecure default, Node.js (since v0.10.33) explicitly disables the use of SSLv3\nand SSLv2 by setting the <code>secureOptions</code> to be\n<code>SSL_OP_NO_SSLv3|SSL_OP_NO_SSLv2</code> (again, unless you have passed\n<code>--enable-ssl3</code>, or <code>--enable-ssl2</code>, or <code>SSLv3_method</code> as <code>secureProtocol</code>).\n\n</p>\n<p>If you have set <code>secureOptions</code> to anything, we will not override your\noptions.\n\n</p>\n<p>The ramifications of this behavior change:\n\n</p>\n<ul>\n<li>If your application is behaving as a secure server, clients who are <code>SSLv3</code>\nonly will now not be able to appropriately negotiate a connection and will be\nrefused. In this case your server will emit a <code>clientError</code> event. The error\nmessage will include <code>&#39;wrong version number&#39;</code>.</li>\n<li>If your application is behaving as a secure client and communicating with a\nserver that doesn&#39;t support methods more secure than SSLv3 then your connection\nwon&#39;t be able to negotiate and will fail. In this case your client will emit a\nan <code>error</code> event. The error message will include <code>&#39;wrong version number&#39;</code>.</li>\n</ul>\n",
          "type": "module",
          "displayName": "Protocol support"
        }
      ],
      "miscs": [
        {
          "textRaw": "Client-initiated renegotiation attack mitigation",
          "name": "Client-initiated renegotiation attack mitigation",
          "type": "misc",
          "desc": "<p>The TLS protocol lets the client renegotiate certain aspects of the TLS session.\nUnfortunately, session renegotiation requires a disproportional amount of\nserver-side resources, which makes it a potential vector for denial-of-service\nattacks.\n\n</p>\n<p>To mitigate this, renegotiations are limited to three times every 10 minutes. An\nerror is emitted on the [tls.TLSSocket][] instance when the threshold is\nexceeded. The limits are configurable:\n\n</p>\n<ul>\n<li><p><code>tls.CLIENT_RENEG_LIMIT</code>: renegotiation limit, default is 3.</p>\n</li>\n<li><p><code>tls.CLIENT_RENEG_WINDOW</code>: renegotiation window in seconds, default is\n10 minutes.</p>\n</li>\n</ul>\n<p>Don&#39;t change the defaults unless you know what you are doing.\n\n</p>\n<p>To test your server, connect to it with <code>openssl s_client -connect address:port</code>\nand tap <code>R&lt;CR&gt;</code> (that&#39;s the letter <code>R</code> followed by a carriage return) a few\ntimes.\n\n\n</p>\n"
        },
        {
          "textRaw": "NPN and SNI",
          "name": "NPN and SNI",
          "type": "misc",
          "desc": "<p>NPN (Next Protocol Negotiation) and SNI (Server Name Indication) are TLS\nhandshake extensions allowing you:\n\n</p>\n<ul>\n<li>NPN - to use one TLS server for multiple protocols (HTTP, SPDY)</li>\n<li>SNI - to use one TLS server for multiple hostnames with different SSL\ncertificates.</li>\n</ul>\n"
        },
        {
          "textRaw": "Perfect Forward Secrecy",
          "name": "Perfect Forward Secrecy",
          "type": "misc",
          "desc": "<p>The term &quot;[Forward Secrecy]&quot; or &quot;Perfect Forward Secrecy&quot; describes a feature of\nkey-agreement (i.e. key-exchange) methods. Practically it means that even if the\nprivate key of a (your) server is compromised, communication can only be\ndecrypted by eavesdroppers if they manage to obtain the key-pair specifically\ngenerated for each session.\n\n</p>\n<p>This is achieved by randomly generating a key pair for key-agreement on every\nhandshake (in contrary to the same key for all sessions). Methods implementing\nthis technique, thus offering Perfect Forward Secrecy, are called &quot;ephemeral&quot;.\n\n</p>\n<p>Currently two methods are commonly used to achieve Perfect Forward Secrecy (note\nthe character &quot;E&quot; appended to the traditional abbreviations):\n\n</p>\n<ul>\n<li>[DHE] - An ephemeral version of the Diffie Hellman key-agreement protocol.</li>\n<li>[ECDHE] - An ephemeral version of the Elliptic Curve Diffie Hellman\nkey-agreement protocol.</li>\n</ul>\n<p>Ephemeral methods may have some performance drawbacks, because key generation\nis expensive.\n\n\n</p>\n"
        }
      ],
      "methods": [
        {
          "textRaw": "tls.getCiphers()",
          "type": "method",
          "name": "getCiphers",
          "desc": "<p>Returns an array with the names of the supported SSL ciphers.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>var ciphers = tls.getCiphers();\nconsole.log(ciphers); // [&#39;AES128-SHA&#39;, &#39;AES256-SHA&#39;, ...]</code></pre>\n",
          "signatures": [
            {
              "params": []
            }
          ]
        },
        {
          "textRaw": "tls.createServer(options[, secureConnectionListener])",
          "type": "method",
          "name": "createServer",
          "desc": "<p>Creates a new [tls.Server][].  The <code>connectionListener</code> argument is\nautomatically set as a listener for the [secureConnection][] event.  The\n<code>options</code> object has these possibilities:\n\n</p>\n<ul>\n<li><p><code>pfx</code>: A string or <code>Buffer</code> containing the private key, certificate and\nCA certs of the server in PFX or PKCS12 format. (Mutually exclusive with\nthe <code>key</code>, <code>cert</code> and <code>ca</code> options.)</p>\n</li>\n<li><p><code>key</code>: A string or <code>Buffer</code> containing the private key of the server in\nPEM format. (Could be an array of keys). (Required)</p>\n</li>\n<li><p><code>passphrase</code>: A string of passphrase for the private key or pfx.</p>\n</li>\n<li><p><code>cert</code>: A string or <code>Buffer</code> containing the certificate key of the server in\nPEM format. (Could be an array of certs). (Required)</p>\n</li>\n<li><p><code>ca</code>: An array of strings or <code>Buffer</code>s of trusted certificates in PEM\nformat. If this is omitted several well known &quot;root&quot; CAs will be used,\nlike VeriSign. These are used to authorize connections.</p>\n</li>\n<li><p><code>crl</code> : Either a string or list of strings of PEM encoded CRLs (Certificate\nRevocation List)</p>\n</li>\n<li><p><code>ciphers</code>: A string describing the ciphers to use or exclude.</p>\n<p>To mitigate [BEAST attacks] it is recommended that you use this option in\nconjunction with the <code>honorCipherOrder</code> option described below to\nprioritize the non-CBC cipher.</p>\n<p>Defaults to\n<code>ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL</code>.\nConsult the [OpenSSL cipher list format documentation] for details\non the format.</p>\n<p><code>ECDHE-RSA-AES128-SHA256</code>, <code>DHE-RSA-AES128-SHA256</code> and\n<code>AES128-GCM-SHA256</code> are TLS v1.2 ciphers and used when node.js is\nlinked against OpenSSL 1.0.1 or newer, such as the bundled version\nof OpenSSL.  Note that it is still possible for a TLS v1.2 client\nto negotiate a weaker cipher unless <code>honorCipherOrder</code> is enabled.</p>\n<p><code>RC4</code> is used as a fallback for clients that speak on older version of\nthe TLS protocol.  <code>RC4</code> has in recent years come under suspicion and\nshould be considered compromised for anything that is truly sensitive.\nIt is speculated that state-level actors possess the ability to break it.</p>\n<p><strong>NOTE</strong>: Previous revisions of this section suggested <code>AES256-SHA</code> as an\nacceptable cipher. Unfortunately, <code>AES256-SHA</code> is a CBC cipher and therefore\nsusceptible to [BEAST attacks]. Do <em>not</em> use it.</p>\n</li>\n<li><p><code>ecdhCurve</code>: A string describing a named curve to use for ECDH key agreement\nor false to disable ECDH.</p>\n<p>Defaults to <code>prime256v1</code>. Consult [RFC 4492] for more details.</p>\n</li>\n<li><p><code>dhparam</code>: DH parameter file to use for DHE key agreement. Use\n<code>openssl dhparam</code> command to create it. If the file is invalid to\nload, it is silently discarded.</p>\n</li>\n<li><p><code>handshakeTimeout</code>: Abort the connection if the SSL/TLS handshake does not\nfinish in this many milliseconds. The default is 120 seconds.</p>\n<p>A <code>&#39;clientError&#39;</code> is emitted on the <code>tls.Server</code> object whenever a handshake\ntimes out.</p>\n</li>\n<li><p><code>honorCipherOrder</code> : When choosing a cipher, use the server&#39;s preferences\ninstead of the client preferences.</p>\n<p>Although, this option is disabled by default, it is <em>recommended</em> that you\nuse this option in conjunction with the <code>ciphers</code> option to mitigate\nBEAST attacks.</p>\n<p>Note: If SSLv2 is used, the server will send its list of preferences to the\nclient, and the client chooses the cipher.  Support for SSLv2 is disabled\nunless node.js was configured with <code>./configure --with-sslv2</code>.</p>\n</li>\n<li><p><code>requestCert</code>: If <code>true</code> the server will request a certificate from\nclients that connect and attempt to verify that certificate. Default:\n<code>false</code>.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: If <code>true</code> the server will reject any connection\nwhich is not authorized with the list of supplied CAs. This option only\nhas an effect if <code>requestCert</code> is <code>true</code>. Default: <code>false</code>.</p>\n</li>\n<li><p><code>checkServerIdentity(servername, cert)</code>: Provide an override for checking\nserver&#39;s hostname against the certificate. Should return an error if verification\nfails. Return <code>undefined</code> if passing.</p>\n</li>\n<li><p><code>NPNProtocols</code>: An array or <code>Buffer</code> of possible NPN protocols. (Protocols\nshould be ordered by their priority).</p>\n</li>\n<li><p><code>SNICallback(servername, cb)</code>: A function that will be called if client\nsupports SNI TLS extension. Two argument will be passed to it: <code>servername</code>,\nand <code>cb</code>. <code>SNICallback</code> should invoke <code>cb(null, ctx)</code>, where <code>ctx</code> is a\nSecureContext instance.\n(You can use <code>tls.createSecureContext(...)</code> to get proper\nSecureContext). If <code>SNICallback</code> wasn&#39;t provided - default callback with\nhigh-level API will be used (see below).</p>\n</li>\n<li><p><code>sessionTimeout</code>: An integer specifying the seconds after which TLS\nsession identifiers and TLS session tickets created by the server are\ntimed out. See [SSL_CTX_set_timeout] for more details.</p>\n</li>\n<li><p><code>ticketKeys</code>: A 48-byte <code>Buffer</code> instance consisting of 16-byte prefix,\n16-byte hmac key, 16-byte AES key. You could use it to accept tls session\ntickets on multiple instances of tls server.</p>\n<p>NOTE: Automatically shared between <code>cluster</code> module workers.</p>\n</li>\n<li><p><code>sessionIdContext</code>: A string containing an opaque identifier for session\nresumption. If <code>requestCert</code> is <code>true</code>, the default is MD5 hash value\ngenerated from command-line. Otherwise, the default is not provided.</p>\n</li>\n<li><p><code>secureProtocol</code>: The SSL method to use, e.g. <code>SSLv3_method</code> to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].</p>\n</li>\n<li><p><code>secureOptions</code>: Set server options. For example, to disable the SSLv3\nprotocol set the <code>SSL_OP_NO_SSLv3</code> flag. See [SSL_CTX_set_options]\nfor all available options.</p>\n</li>\n</ul>\n<p>Here is a simple example echo server:\n\n</p>\n<pre><code>var tls = require(&#39;tls&#39;);\nvar fs = require(&#39;fs&#39;);\n\nvar options = {\n  key: fs.readFileSync(&#39;server-key.pem&#39;),\n  cert: fs.readFileSync(&#39;server-cert.pem&#39;),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n  // This is necessary only if the client uses the self-signed certificate.\n  ca: [ fs.readFileSync(&#39;client-cert.pem&#39;) ]\n};\n\nvar server = tls.createServer(options, function(socket) {\n  console.log(&#39;server connected&#39;,\n              socket.authorized ? &#39;authorized&#39; : &#39;unauthorized&#39;);\n  socket.write(&quot;welcome!\\n&quot;);\n  socket.setEncoding(&#39;utf8&#39;);\n  socket.pipe(socket);\n});\nserver.listen(8000, function() {\n  console.log(&#39;server bound&#39;);\n});</code></pre>\n<p>Or\n\n</p>\n<pre><code>var tls = require(&#39;tls&#39;);\nvar fs = require(&#39;fs&#39;);\n\nvar options = {\n  pfx: fs.readFileSync(&#39;server.pfx&#39;),\n\n  // This is necessary only if using the client certificate authentication.\n  requestCert: true,\n\n};\n\nvar server = tls.createServer(options, function(socket) {\n  console.log(&#39;server connected&#39;,\n              socket.authorized ? &#39;authorized&#39; : &#39;unauthorized&#39;);\n  socket.write(&quot;welcome!\\n&quot;);\n  socket.setEncoding(&#39;utf8&#39;);\n  socket.pipe(socket);\n});\nserver.listen(8000, function() {\n  console.log(&#39;server bound&#39;);\n});</code></pre>\n<p>You can test this server by connecting to it with <code>openssl s_client</code>:\n\n\n</p>\n<pre><code>openssl s_client -connect 127.0.0.1:8000</code></pre>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "options"
                },
                {
                  "name": "secureConnectionListener",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "tls.connect(options[, callback])",
          "type": "method",
          "name": "connect",
          "desc": "<p>Creates a new client connection to the given <code>port</code> and <code>host</code> (old API) or\n<code>options.port</code> and <code>options.host</code>. (If <code>host</code> is omitted, it defaults to\n<code>localhost</code>.) <code>options</code> should be an object which specifies:\n\n</p>\n<ul>\n<li><p><code>host</code>: Host the client should connect to</p>\n</li>\n<li><p><code>port</code>: Port the client should connect to</p>\n</li>\n<li><p><code>socket</code>: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, <code>host</code> and <code>port</code>\nare ignored.</p>\n</li>\n<li><p><code>path</code>: Creates unix socket connection to path. If this option is\nspecified, <code>host</code> and <code>port</code> are ignored.</p>\n</li>\n<li><p><code>pfx</code>: A string or <code>Buffer</code> containing the private key, certificate and\nCA certs of the client in PFX or PKCS12 format.</p>\n</li>\n<li><p><code>key</code>: A string or <code>Buffer</code> containing the private key of the client in\nPEM format. (Could be an array of keys).</p>\n</li>\n<li><p><code>passphrase</code>: A string of passphrase for the private key or pfx.</p>\n</li>\n<li><p><code>cert</code>: A string or <code>Buffer</code> containing the certificate key of the client in\nPEM format. (Could be an array of certs).</p>\n</li>\n<li><p><code>ca</code>: An array of strings or <code>Buffer</code>s of trusted certificates in PEM\nformat. If this is omitted several well known &quot;root&quot; CAs will be used,\nlike VeriSign. These are used to authorize connections.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: If <code>true</code>, the server certificate is verified against\nthe list of supplied CAs. An <code>&#39;error&#39;</code> event is emitted if verification\nfails; <code>err.code</code> contains the OpenSSL error code. Default: <code>true</code>.</p>\n</li>\n<li><p><code>NPNProtocols</code>: An array of strings or <code>Buffer</code>s containing supported NPN\nprotocols. <code>Buffer</code>s should have following format: <code>0x05hello0x05world</code>,\nwhere first byte is next protocol name&#39;s length. (Passing array should\nusually be much simpler: <code>[&#39;hello&#39;, &#39;world&#39;]</code>.)</p>\n</li>\n<li><p><code>servername</code>: Servername for SNI (Server Name Indication) TLS extension.</p>\n</li>\n<li><p><code>secureProtocol</code>: The SSL method to use, e.g. <code>SSLv3_method</code> to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].</p>\n</li>\n<li><p><code>session</code>: A <code>Buffer</code> instance, containing TLS session.</p>\n</li>\n</ul>\n<p>The <code>callback</code> parameter will be added as a listener for the\n[&#39;secureConnect&#39;][] event.\n\n</p>\n<p><code>tls.connect()</code> returns a [tls.TLSSocket][] object.\n\n</p>\n<p>Here is an example of a client of echo server as described previously:\n\n</p>\n<pre><code>var tls = require(&#39;tls&#39;);\nvar fs = require(&#39;fs&#39;);\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync(&#39;client-key.pem&#39;),\n  cert: fs.readFileSync(&#39;client-cert.pem&#39;),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync(&#39;server-cert.pem&#39;) ]\n};\n\nvar socket = tls.connect(8000, options, function() {\n  console.log(&#39;client connected&#39;,\n              socket.authorized ? &#39;authorized&#39; : &#39;unauthorized&#39;);\n  process.stdin.pipe(socket);\n  process.stdin.resume();\n});\nsocket.setEncoding(&#39;utf8&#39;);\nsocket.on(&#39;data&#39;, function(data) {\n  console.log(data);\n});\nsocket.on(&#39;end&#39;, function() {\n  server.close();\n});</code></pre>\n<p>Or\n\n</p>\n<pre><code>var tls = require(&#39;tls&#39;);\nvar fs = require(&#39;fs&#39;);\n\nvar options = {\n  pfx: fs.readFileSync(&#39;client.pfx&#39;)\n};\n\nvar socket = tls.connect(8000, options, function() {\n  console.log(&#39;client connected&#39;,\n              socket.authorized ? &#39;authorized&#39; : &#39;unauthorized&#39;);\n  process.stdin.pipe(socket);\n  process.stdin.resume();\n});\nsocket.setEncoding(&#39;utf8&#39;);\nsocket.on(&#39;data&#39;, function(data) {\n  console.log(data);\n});\nsocket.on(&#39;end&#39;, function() {\n  server.close();\n});</code></pre>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "port"
                },
                {
                  "name": "host",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "callback",
                  "optional": true
                }
              ]
            },
            {
              "params": [
                {
                  "name": "options"
                },
                {
                  "name": "callback",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "tls.connect(port[, host][, options][, callback])",
          "type": "method",
          "name": "connect",
          "desc": "<p>Creates a new client connection to the given <code>port</code> and <code>host</code> (old API) or\n<code>options.port</code> and <code>options.host</code>. (If <code>host</code> is omitted, it defaults to\n<code>localhost</code>.) <code>options</code> should be an object which specifies:\n\n</p>\n<ul>\n<li><p><code>host</code>: Host the client should connect to</p>\n</li>\n<li><p><code>port</code>: Port the client should connect to</p>\n</li>\n<li><p><code>socket</code>: Establish secure connection on a given socket rather than\ncreating a new socket. If this option is specified, <code>host</code> and <code>port</code>\nare ignored.</p>\n</li>\n<li><p><code>path</code>: Creates unix socket connection to path. If this option is\nspecified, <code>host</code> and <code>port</code> are ignored.</p>\n</li>\n<li><p><code>pfx</code>: A string or <code>Buffer</code> containing the private key, certificate and\nCA certs of the client in PFX or PKCS12 format.</p>\n</li>\n<li><p><code>key</code>: A string or <code>Buffer</code> containing the private key of the client in\nPEM format. (Could be an array of keys).</p>\n</li>\n<li><p><code>passphrase</code>: A string of passphrase for the private key or pfx.</p>\n</li>\n<li><p><code>cert</code>: A string or <code>Buffer</code> containing the certificate key of the client in\nPEM format. (Could be an array of certs).</p>\n</li>\n<li><p><code>ca</code>: An array of strings or <code>Buffer</code>s of trusted certificates in PEM\nformat. If this is omitted several well known &quot;root&quot; CAs will be used,\nlike VeriSign. These are used to authorize connections.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: If <code>true</code>, the server certificate is verified against\nthe list of supplied CAs. An <code>&#39;error&#39;</code> event is emitted if verification\nfails; <code>err.code</code> contains the OpenSSL error code. Default: <code>true</code>.</p>\n</li>\n<li><p><code>NPNProtocols</code>: An array of strings or <code>Buffer</code>s containing supported NPN\nprotocols. <code>Buffer</code>s should have following format: <code>0x05hello0x05world</code>,\nwhere first byte is next protocol name&#39;s length. (Passing array should\nusually be much simpler: <code>[&#39;hello&#39;, &#39;world&#39;]</code>.)</p>\n</li>\n<li><p><code>servername</code>: Servername for SNI (Server Name Indication) TLS extension.</p>\n</li>\n<li><p><code>secureProtocol</code>: The SSL method to use, e.g. <code>SSLv3_method</code> to force\nSSL version 3. The possible values depend on your installation of\nOpenSSL and are defined in the constant [SSL_METHODS][].</p>\n</li>\n<li><p><code>session</code>: A <code>Buffer</code> instance, containing TLS session.</p>\n</li>\n</ul>\n<p>The <code>callback</code> parameter will be added as a listener for the\n[&#39;secureConnect&#39;][] event.\n\n</p>\n<p><code>tls.connect()</code> returns a [tls.TLSSocket][] object.\n\n</p>\n<p>Here is an example of a client of echo server as described previously:\n\n</p>\n<pre><code>var tls = require(&#39;tls&#39;);\nvar fs = require(&#39;fs&#39;);\n\nvar options = {\n  // These are necessary only if using the client certificate authentication\n  key: fs.readFileSync(&#39;client-key.pem&#39;),\n  cert: fs.readFileSync(&#39;client-cert.pem&#39;),\n\n  // This is necessary only if the server uses the self-signed certificate\n  ca: [ fs.readFileSync(&#39;server-cert.pem&#39;) ]\n};\n\nvar socket = tls.connect(8000, options, function() {\n  console.log(&#39;client connected&#39;,\n              socket.authorized ? &#39;authorized&#39; : &#39;unauthorized&#39;);\n  process.stdin.pipe(socket);\n  process.stdin.resume();\n});\nsocket.setEncoding(&#39;utf8&#39;);\nsocket.on(&#39;data&#39;, function(data) {\n  console.log(data);\n});\nsocket.on(&#39;end&#39;, function() {\n  server.close();\n});</code></pre>\n<p>Or\n\n</p>\n<pre><code>var tls = require(&#39;tls&#39;);\nvar fs = require(&#39;fs&#39;);\n\nvar options = {\n  pfx: fs.readFileSync(&#39;client.pfx&#39;)\n};\n\nvar socket = tls.connect(8000, options, function() {\n  console.log(&#39;client connected&#39;,\n              socket.authorized ? &#39;authorized&#39; : &#39;unauthorized&#39;);\n  process.stdin.pipe(socket);\n  process.stdin.resume();\n});\nsocket.setEncoding(&#39;utf8&#39;);\nsocket.on(&#39;data&#39;, function(data) {\n  console.log(data);\n});\nsocket.on(&#39;end&#39;, function() {\n  server.close();\n});</code></pre>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "port"
                },
                {
                  "name": "host",
                  "optional": true
                },
                {
                  "name": "options",
                  "optional": true
                },
                {
                  "name": "callback",
                  "optional": true
                }
              ]
            }
          ]
        },
        {
          "textRaw": "new tls.TLSSocket(socket, options)",
          "type": "method",
          "name": "TLSSocket",
          "desc": "<p>Construct a new TLSSocket object from existing TCP socket.\n\n</p>\n<p><code>socket</code> is an instance of [net.Socket][]\n\n</p>\n<p><code>options</code> is an object that might contain following properties:\n\n</p>\n<ul>\n<li><p><code>secureContext</code>: An optional TLS context object from\n <code>tls.createSecureContext( ... )</code></p>\n</li>\n<li><p><code>isServer</code>: If true - TLS socket will be instantiated in server-mode</p>\n</li>\n<li><p><code>server</code>: An optional [net.Server][] instance</p>\n</li>\n<li><p><code>requestCert</code>: Optional, see [tls.createSecurePair][]</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: Optional, see [tls.createSecurePair][]</p>\n</li>\n<li><p><code>NPNProtocols</code>: Optional, see [tls.createServer][]</p>\n</li>\n<li><p><code>SNICallback</code>: Optional, see [tls.createServer][]</p>\n</li>\n<li><p><code>session</code>: Optional, a <code>Buffer</code> instance, containing TLS session</p>\n</li>\n<li><p><code>requestOCSP</code>: Optional, if <code>true</code> - OCSP status request extension would\nbe added to client hello, and <code>OCSPResponse</code> event will be emitted on socket\nbefore establishing secure communication</p>\n</li>\n</ul>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "socket"
                },
                {
                  "name": "options"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "tls.createSecureContext(details)",
          "type": "method",
          "name": "createSecureContext",
          "desc": "<p>Creates a credentials object, with the optional details being a\ndictionary with keys:\n\n</p>\n<ul>\n<li><code>pfx</code> : A string or buffer holding the PFX or PKCS12 encoded private\nkey, certificate and CA certificates</li>\n<li><code>key</code> : A string holding the PEM encoded private key</li>\n<li><code>passphrase</code> : A string of passphrase for the private key or pfx</li>\n<li><code>cert</code> : A string holding the PEM encoded certificate</li>\n<li><code>ca</code> : Either a string or list of strings of PEM encoded CA\ncertificates to trust.</li>\n<li><code>crl</code> : Either a string or list of strings of PEM encoded CRLs\n(Certificate Revocation List)</li>\n<li><code>ciphers</code>: A string describing the ciphers to use or exclude.\nConsult\n<a href=\"http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT\">http://www.openssl.org/docs/apps/ciphers.html#CIPHER_LIST_FORMAT</a>\nfor details on the format.</li>\n<li><code>honorCipherOrder</code> : When choosing a cipher, use the server&#39;s preferences\ninstead of the client preferences. For further details see <code>tls</code> module\ndocumentation.</li>\n</ul>\n<p>If no &#39;ca&#39; details are given, then node.js will use the default\npublicly trusted list of CAs as given in\n</p>\n<p><a href=\"http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt\">http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt</a>.\n\n\n</p>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "details"
                }
              ]
            }
          ]
        },
        {
          "textRaw": "tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized])",
          "type": "method",
          "name": "createSecurePair",
          "desc": "<p>Creates a new secure pair object with two streams, one of which reads/writes\nencrypted data, and one reads/writes cleartext data.\nGenerally the encrypted one is piped to/from an incoming encrypted data stream,\nand the cleartext one is used as a replacement for the initial encrypted stream.\n\n</p>\n<ul>\n<li><p><code>credentials</code>: A secure context object from tls.createSecureContext( ... )</p>\n</li>\n<li><p><code>isServer</code>: A boolean indicating whether this tls connection should be\nopened as a server or a client.</p>\n</li>\n<li><p><code>requestCert</code>: A boolean indicating whether a server should request a\ncertificate from a connecting client. Only applies to server connections.</p>\n</li>\n<li><p><code>rejectUnauthorized</code>: A boolean indicating whether a server should\nautomatically reject clients with invalid certificates. Only applies to\nservers with <code>requestCert</code> enabled.</p>\n</li>\n</ul>\n<p><code>tls.createSecurePair()</code> returns a SecurePair object with <code>cleartext</code> and\n<code>encrypted</code> stream properties.\n\n</p>\n<p>NOTE: <code>cleartext</code> has the same APIs as [tls.TLSSocket][]\n\n</p>\n",
          "signatures": [
            {
              "params": [
                {
                  "name": "context",
                  "optional": true
                },
                {
                  "name": "isServer",
                  "optional": true
                },
                {
                  "name": "requestCert",
                  "optional": true
                },
                {
                  "name": "rejectUnauthorized",
                  "optional": true
                }
              ]
            }
          ]
        }
      ],
      "classes": [
        {
          "textRaw": "Class: tls.TLSSocket",
          "type": "class",
          "name": "tls.TLSSocket",
          "desc": "<p>Wrapper for instance of [net.Socket][], replaces internal socket read/write\nroutines to perform transparent encryption/decryption of incoming/outgoing data.\n\n</p>\n"
        },
        {
          "textRaw": "Class: SecurePair",
          "type": "class",
          "name": "SecurePair",
          "desc": "<p>Returned by tls.createSecurePair.\n\n</p>\n",
          "events": [
            {
              "textRaw": "Event: 'secure'",
              "type": "event",
              "name": "secure",
              "desc": "<p>The event is emitted from the SecurePair once the pair has successfully\nestablished a secure connection.\n\n</p>\n<p>Similarly to the checking for the server &#39;secureConnection&#39; event,\npair.cleartext.authorized should be checked to confirm whether the certificate\nused properly authorized.\n\n</p>\n",
              "params": []
            }
          ]
        },
        {
          "textRaw": "Class: tls.Server",
          "type": "class",
          "name": "tls.Server",
          "desc": "<p>This class is a subclass of <code>net.Server</code> and has the same methods on it.\nInstead of accepting just raw TCP connections, this accepts encrypted\nconnections using TLS or SSL.\n\n</p>\n",
          "events": [
            {
              "textRaw": "Event: 'secureConnection'",
              "type": "event",
              "name": "secureConnection",
              "desc": "<p><code>function (tlsSocket) {}</code>\n\n</p>\n<p>This event is emitted after a new connection has been successfully\nhandshaked. The argument is an instance of [tls.TLSSocket][]. It has all the\ncommon stream methods and events.\n\n</p>\n<p><code>socket.authorized</code> is a boolean value which indicates if the\nclient has verified by one of the supplied certificate authorities for the\nserver. If <code>socket.authorized</code> is false, then\n<code>socket.authorizationError</code> is set to describe how authorization\nfailed. Implied but worth mentioning: depending on the settings of the TLS\nserver, you unauthorized connections may be accepted.\n<code>socket.npnProtocol</code> is a string containing selected NPN protocol.\n<code>socket.servername</code> is a string containing servername requested with\nSNI.\n\n\n</p>\n",
              "params": []
            },
            {
              "textRaw": "Event: 'clientError'",
              "type": "event",
              "name": "clientError",
              "desc": "<p><code>function (exception, tlsSocket) { }</code>\n\n</p>\n<p>When a client connection emits an &#39;error&#39; event before secure connection is\nestablished - it will be forwarded here.\n\n</p>\n<p><code>tlsSocket</code> is the [tls.TLSSocket][] that the error originated from.\n\n\n</p>\n",
              "params": []
            },
            {
              "textRaw": "Event: 'newSession'",
              "type": "event",
              "name": "newSession",
              "desc": "<p><code>function (sessionId, sessionData, callback) { }</code>\n\n</p>\n<p>Emitted on creation of TLS session. May be used to store sessions in external\nstorage. <code>callback</code> must be invoked eventually, otherwise no data will be\nsent or received from secure connection.\n\n</p>\n<p>NOTE: adding this event listener will have an effect only on connections\nestablished after addition of event listener.\n\n\n</p>\n",
              "params": []
            },
            {
              "textRaw": "Event: 'resumeSession'",
              "type": "event",
              "name": "resumeSession",
              "desc": "<p><code>function (sessionId, callback) { }</code>\n\n</p>\n<p>Emitted when client wants to resume previous TLS session. Event listener may\nperform lookup in external storage using given <code>sessionId</code>, and invoke\n<code>callback(null, sessionData)</code> once finished. If session can&#39;t be resumed\n(i.e. doesn&#39;t exist in storage) one may call <code>callback(null, null)</code>. Calling\n<code>callback(err)</code> will terminate incoming connection and destroy socket.\n\n</p>\n<p>NOTE: adding this event listener will have an effect only on connections\nestablished after addition of event listener.\n\n\n</p>\n",
              "params": []
            },
            {
              "textRaw": "Event: 'OCSPRequest'",
              "type": "event",
              "name": "OCSPRequest",
              "desc": "<p><code>function (certificate, issuer, callback) { }</code>\n\n</p>\n<p>Emitted when the client sends a certificate status request. You could parse\nserver&#39;s current certificate to obtain OCSP url and certificate id, and after\nobtaining OCSP response invoke <code>callback(null, resp)</code>, where <code>resp</code> is a\n<code>Buffer</code> instance. Both <code>certificate</code> and <code>issuer</code> are a <code>Buffer</code>\nDER-representations of the primary and issuer&#39;s certificates. They could be used\nto obtain OCSP certificate id and OCSP endpoint url.\n\n</p>\n<p>Alternatively, <code>callback(null, null)</code> could be called, meaning that there is no\nOCSP response.\n\n</p>\n<p>Calling <code>callback(err)</code> will result in a <code>socket.destroy(err)</code> call.\n\n</p>\n<p>Typical flow:\n\n</p>\n<ol>\n<li>Client connects to server and sends <code>OCSPRequest</code> to it (via status info\nextension in ClientHello.)</li>\n<li>Server receives request and invokes <code>OCSPRequest</code> event listener if present</li>\n<li>Server grabs OCSP url from either <code>certificate</code> or <code>issuer</code> and performs an\n[OCSP request] to the CA</li>\n<li>Server receives <code>OCSPResponse</code> from CA and sends it back to client via\n<code>callback</code> argument</li>\n<li>Client validates the response and either destroys socket or performs a\nhandshake.</li>\n</ol>\n<p>NOTE: <code>issuer</code> could be null, if the certificate is self-signed or if the issuer\nis not in the root certificates list. (You could provide an issuer via <code>ca</code>\noption.)\n\n</p>\n<p>NOTE: adding this event listener will have an effect only on connections\nestablished after addition of event listener.\n\n</p>\n<p>NOTE: you may want to use some npm module like [asn1.js] to parse the\ncertificates.\n\n\n</p>\n",
              "params": []
            }
          ],
          "methods": [
            {
              "textRaw": "server.listen(port[, host][, callback])",
              "type": "method",
              "name": "listen",
              "desc": "<p>Begin accepting connections on the specified <code>port</code> and <code>host</code>.  If the\n<code>host</code> is omitted, the server will accept connections directed to any\nIPv4 address (<code>INADDR_ANY</code>).\n\n</p>\n<p>This function is asynchronous. The last parameter <code>callback</code> will be called\nwhen the server has been bound.\n\n</p>\n<p>See <code>net.Server</code> for more information.\n\n\n</p>\n",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "port"
                    },
                    {
                      "name": "host",
                      "optional": true
                    },
                    {
                      "name": "callback",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "server.close()",
              "type": "method",
              "name": "close",
              "desc": "<p>Stops the server from accepting new connections. This function is\nasynchronous, the server is finally closed when the server emits a <code>&#39;close&#39;</code>\nevent.\n\n</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "server.address()",
              "type": "method",
              "name": "address",
              "desc": "<p>Returns the bound address, the address family name and port of the\nserver as reported by the operating system.  See [net.Server.address()][] for\nmore information.\n\n</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "server.addContext(hostname, context)",
              "type": "method",
              "name": "addContext",
              "desc": "<p>Add secure context that will be used if client request&#39;s SNI hostname is\nmatching passed <code>hostname</code> (wildcards can be used). <code>context</code> can contain\n<code>key</code>, <code>cert</code>, <code>ca</code> and/or any other properties from <code>tls.createSecureContext</code>\n<code>options</code> argument.\n\n</p>\n",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "hostname"
                    },
                    {
                      "name": "context"
                    }
                  ]
                }
              ]
            }
          ],
          "properties": [
            {
              "textRaw": "server.maxConnections",
              "name": "maxConnections",
              "desc": "<p>Set this property to reject connections when the server&#39;s connection count\ngets high.\n\n</p>\n"
            },
            {
              "textRaw": "server.connections",
              "name": "connections",
              "desc": "<p>The number of concurrent connections on the server.\n\n\n</p>\n"
            }
          ]
        },
        {
          "textRaw": "Class: CryptoStream",
          "type": "class",
          "name": "CryptoStream",
          "stability": 0,
          "stabilityText": "Deprecated. Use tls.TLSSocket instead.",
          "desc": "<p>This is an encrypted stream.\n\n</p>\n",
          "properties": [
            {
              "textRaw": "cryptoStream.bytesWritten",
              "name": "bytesWritten",
              "desc": "<p>A proxy to the underlying socket&#39;s bytesWritten accessor, this will return\nthe total bytes written to the socket, <em>including the TLS overhead</em>.\n\n</p>\n"
            }
          ]
        },
        {
          "textRaw": "Class: tls.TLSSocket",
          "type": "class",
          "name": "tls.TLSSocket",
          "desc": "<p>This is a wrapped version of [net.Socket][] that does transparent encryption\nof written data and all required TLS negotiation.\n\n</p>\n<p>This instance implements a duplex [Stream][] interfaces.  It has all the\ncommon stream methods and events.\n\n</p>\n",
          "events": [
            {
              "textRaw": "Event: 'secureConnect'",
              "type": "event",
              "name": "secureConnect",
              "desc": "<p>This event is emitted after a new connection has been successfully handshaked.\nThe listener will be called no matter if the server&#39;s certificate was\nauthorized or not. It is up to the user to test <code>tlsSocket.authorized</code>\nto see if the server certificate was signed by one of the specified CAs.\nIf <code>tlsSocket.authorized === false</code> then the error can be found in\n<code>tlsSocket.authorizationError</code>. Also if NPN was used - you can check\n<code>tlsSocket.npnProtocol</code> for negotiated protocol.\n\n</p>\n",
              "params": []
            },
            {
              "textRaw": "Event: 'OCSPResponse'",
              "type": "event",
              "name": "OCSPResponse",
              "desc": "<p><code>function (response) { }</code>\n\n</p>\n<p>This event will be emitted if <code>requestOCSP</code> option was set. <code>response</code> is a\nbuffer object, containing server&#39;s OCSP response.\n\n</p>\n<p>Traditionally, the <code>response</code> is a signed object from the server&#39;s CA that\ncontains information about server&#39;s certificate revocation status.\n\n</p>\n",
              "params": []
            }
          ],
          "properties": [
            {
              "textRaw": "tlsSocket.encrypted",
              "name": "encrypted",
              "desc": "<p>Static boolean value, always <code>true</code>. May be used to distinguish TLS sockets\nfrom regular ones.\n\n</p>\n"
            },
            {
              "textRaw": "tlsSocket.authorized",
              "name": "authorized",
              "desc": "<p>A boolean that is <code>true</code> if the peer certificate was signed by one of the\nspecified CAs, otherwise <code>false</code>\n\n</p>\n"
            },
            {
              "textRaw": "tlsSocket.authorizationError",
              "name": "authorizationError",
              "desc": "<p>The reason why the peer&#39;s certificate has not been verified. This property\nbecomes available only when <code>tlsSocket.authorized === false</code>.\n\n</p>\n"
            },
            {
              "textRaw": "tlsSocket.remoteAddress",
              "name": "remoteAddress",
              "desc": "<p>The string representation of the remote IP address. For example,\n<code>&#39;74.125.127.100&#39;</code> or <code>&#39;2001:4860:a005::68&#39;</code>.\n\n</p>\n"
            },
            {
              "textRaw": "tlsSocket.remoteFamily",
              "name": "remoteFamily",
              "desc": "<p>The string representation of the remote IP family. <code>&#39;IPv4&#39;</code> or <code>&#39;IPv6&#39;</code>.\n\n</p>\n"
            },
            {
              "textRaw": "tlsSocket.remotePort",
              "name": "remotePort",
              "desc": "<p>The numeric representation of the remote port. For example, <code>443</code>.\n\n</p>\n"
            },
            {
              "textRaw": "tlsSocket.localAddress",
              "name": "localAddress",
              "desc": "<p>The string representation of the local IP address.\n\n</p>\n"
            },
            {
              "textRaw": "tlsSocket.localPort",
              "name": "localPort",
              "desc": "<p>The numeric representation of the local port.\n\n</p>\n"
            }
          ],
          "methods": [
            {
              "textRaw": "tlsSocket.getPeerCertificate([ detailed ])",
              "type": "method",
              "name": "getPeerCertificate",
              "desc": "<p>Returns an object representing the peer&#39;s certificate. The returned object has\nsome properties corresponding to the field of the certificate. If <code>detailed</code>\nargument is <code>true</code> - the full chain with <code>issuer</code> property will be returned,\nif <code>false</code> - only the top certificate without <code>issuer</code> property.\n\n</p>\n<p>Example:\n\n</p>\n<pre><code>{ subject:\n   { C: &#39;UK&#39;,\n     ST: &#39;Acknack Ltd&#39;,\n     L: &#39;Rhys Jones&#39;,\n     O: &#39;node.js&#39;,\n     OU: &#39;Test TLS Certificate&#39;,\n     CN: &#39;localhost&#39; },\n  issuerInfo:\n   { C: &#39;UK&#39;,\n     ST: &#39;Acknack Ltd&#39;,\n     L: &#39;Rhys Jones&#39;,\n     O: &#39;node.js&#39;,\n     OU: &#39;Test TLS Certificate&#39;,\n     CN: &#39;localhost&#39; },\n  issuer:\n   { ... another certificate ... },\n  raw: &lt; RAW DER buffer &gt;,\n  valid_from: &#39;Nov 11 09:52:22 2009 GMT&#39;,\n  valid_to: &#39;Nov  6 09:52:22 2029 GMT&#39;,\n  fingerprint: &#39;2A:7A:C2:DD:E5:F9:CC:53:72:35:99:7A:02:5A:71:38:52:EC:8A:DF&#39;,\n  serialNumber: &#39;B9B0D332A1AA5635&#39; }</code></pre>\n<p>If the peer does not provide a certificate, it returns <code>null</code> or an empty\nobject.\n\n</p>\n",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "detailed",
                      "optional": true
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "tlsSocket.getCipher()",
              "type": "method",
              "name": "getCipher",
              "desc": "<p>Returns an object representing the cipher name and the SSL/TLS\nprotocol version of the current connection.\n\n</p>\n<p>Example:\n{ name: &#39;AES256-SHA&#39;, version: &#39;TLSv1/SSLv3&#39; }\n\n</p>\n<p>See SSL_CIPHER_get_name() and SSL_CIPHER_get_version() in\n<a href=\"http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_CIPHERS\">http://www.openssl.org/docs/ssl/ssl.html#DEALING_WITH_CIPHERS</a> for more\ninformation.\n\n</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "tlsSocket.renegotiate(options, callback)",
              "type": "method",
              "name": "renegotiate",
              "desc": "<p>Initiate TLS renegotiation process. The <code>options</code> may contain the following\nfields: <code>rejectUnauthorized</code>, <code>requestCert</code> (See [tls.createServer][]\nfor details). <code>callback(err)</code> will be executed with <code>null</code> as <code>err</code>,\nonce the renegotiation is successfully completed.\n\n</p>\n<p>NOTE: Can be used to request peer&#39;s certificate after the secure connection\nhas been established.\n\n</p>\n<p>ANOTHER NOTE: When running as the server, socket will be destroyed\nwith an error after <code>handshakeTimeout</code> timeout.\n\n</p>\n",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "options"
                    },
                    {
                      "name": "callback"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "tlsSocket.setMaxSendFragment(size)",
              "type": "method",
              "name": "setMaxSendFragment",
              "desc": "<p>Set maximum TLS fragment size (default and maximum value is: <code>16384</code>, minimum\nis: <code>512</code>). Returns <code>true</code> on success, <code>false</code> otherwise.\n\n</p>\n<p>Smaller fragment size decreases buffering latency on the client: large\nfragments are buffered by the TLS layer until the entire fragment is received\nand its integrity is verified; large fragments can span multiple roundtrips,\nand their processing can be delayed due to packet loss or reordering. However,\nsmaller fragments add extra TLS framing bytes and CPU overhead, which may\ndecrease overall server throughput.\n\n</p>\n",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "size"
                    }
                  ]
                }
              ]
            },
            {
              "textRaw": "tlsSocket.getSession()",
              "type": "method",
              "name": "getSession",
              "desc": "<p>Return ASN.1 encoded TLS session or <code>undefined</code> if none was negotiated. Could\nbe used to speed up handshake establishment when reconnecting to the server.\n\n</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "tlsSocket.getTLSTicket()",
              "type": "method",
              "name": "getTLSTicket",
              "desc": "<p>NOTE: Works only with client TLS sockets. Useful only for debugging, for\nsession reuse provide <code>session</code> option to <code>tls.connect</code>.\n\n</p>\n<p>Return TLS session ticket or <code>undefined</code> if none was negotiated.\n\n</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            },
            {
              "textRaw": "tlsSocket.address()",
              "type": "method",
              "name": "address",
              "desc": "<p>Returns the bound address, the address family name and port of the\nunderlying socket as reported by the operating system. Returns an\nobject with three properties, e.g.\n<code>{ port: 12346, family: &#39;IPv4&#39;, address: &#39;127.0.0.1&#39; }</code>\n\n</p>\n",
              "signatures": [
                {
                  "params": []
                }
              ]
            }
          ]
        }
      ],
      "type": "module",
      "displayName": "TLS (SSL)"
    }
  ]
}
