{
  "type": "module",
  "source": "doc/api/dtls.md",
  "modules": [
    {
      "textRaw": "DTLS",
      "name": "dtls",
      "introduced_in": "REPLACEME",
      "type": "module",
      "meta": {
        "added": [
          "REPLACEME"
        ],
        "changes": []
      },
      "stability": 1,
      "stabilityText": "Experimental",
      "desc": "<p>The <code>node:dtls</code> module provides an implementation of the Datagram Transport\nLayer Security (DTLS) protocol over UDP. DTLS provides TLS-equivalent\nsecurity guarantees for datagram-based communication, including\nconfidentiality, integrity, and authentication.</p>\n<p>To use this module, it must be enabled at build time with the\n<code>--experimental-dtls</code> configure flag and at runtime with the\n<code>--experimental-dtls</code> CLI flag.</p>\n<pre><code class=\"language-bash\">node --experimental-dtls app.mjs\n</code></pre>\n<pre><code class=\"language-mjs\">import { listen, connect } from 'node:dtls';\n</code></pre>\n<pre><code class=\"language-cjs\">const { listen, connect } = require('node:dtls');\n</code></pre>",
      "modules": [
        {
          "textRaw": "Permission model",
          "name": "permission_model",
          "type": "module",
          "desc": "<p>When using the <a href=\"permissions.html#permission-model\">Permission Model</a>, the <code>--allow-net</code> flag must be passed to\nallow DTLS network operations. Without it, calling <a href=\"#dtlsconnecthost-port-options\"><code>dtls.connect()</code></a> or\n<a href=\"#dtlslistencallback-options\"><code>dtls.listen()</code></a> will throw an <code>ERR_ACCESS_DENIED</code> error.</p>\n<pre><code class=\"language-console\">node --permission --allow-fs-read=* --experimental-dtls index.mjs\nError: Access to this API has been restricted. Use --allow-net to manage permissions.\n  code: 'ERR_ACCESS_DENIED',\n  permission: 'Net',\n}\n</code></pre>\n<p>Creating a <a href=\"#class-dtlsendpoint\"><code>DTLSEndpoint</code></a> instance without connecting or listening\nis permitted even without <code>--allow-net</code>, since no network I/O occurs until\n<a href=\"#dtlsconnecthost-port-options\"><code>dtls.connect()</code></a> or <a href=\"#dtlslistencallback-options\"><code>dtls.listen()</code></a> is called.</p>",
          "displayName": "Permission model"
        },
        {
          "textRaw": "DTLS vs TLS",
          "name": "dtls_vs_tls",
          "type": "module",
          "desc": "<p>DTLS is designed for UDP transport and differs from TLS in several key ways:</p>\n<ul>\n<li>No stream guarantees: Messages may arrive out of order or be lost.\nDTLS preserves datagram semantics.</li>\n<li>One socket, many peers: A single UDP socket can serve multiple DTLS\nsessions. The <code>DTLSEndpoint</code> manages this multiplexing.</li>\n<li>Cookie exchange: DTLS servers use a stateless cookie mechanism\n(HelloVerifyRequest) to prevent denial-of-service amplification attacks.</li>\n<li>Retransmission: DTLS handles handshake retransmission internally since\nUDP does not guarantee delivery.</li>\n</ul>",
          "displayName": "DTLS vs TLS"
        },
        {
          "textRaw": "DTLS-SRTP example",
          "name": "dtls-srtp_example",
          "type": "module",
          "desc": "<p>DTLS-SRTP is used by WebRTC for media encryption. The DTLS handshake\nnegotiates the SRTP protection profile and provides keying material.</p>\n<pre><code class=\"language-mjs\">import { listen, connect } from 'node:dtls';\nimport { readFileSync } from 'node:fs';\n\n// Server with SRTP\nconst server = listen((session) => {\n  session.onhandshake = () => {\n    console.log('SRTP profile:', session.srtpProfile);\n    const keys = session.exportKeyingMaterial(\n      60,\n      'EXTRACTOR-dtls_srtp',\n    );\n    console.log('SRTP keying material:', keys);\n  };\n}, {\n  cert: readFileSync('server-cert.pem'),\n  key: readFileSync('server-key.pem'),\n  port: 5004,\n  srtp: 'SRTP_AES128_CM_SHA1_80:SRTP_AEAD_AES_128_GCM',\n});\n\n// Client with SRTP\nconst session = connect('localhost', 5004, {\n  rejectUnauthorized: false,\n  srtp: 'SRTP_AEAD_AES_128_GCM:SRTP_AES128_CM_SHA1_80',\n});\n\nawait session.opened;\nconsole.log('Negotiated SRTP:', session.srtpProfile);\nconst keys = session.exportKeyingMaterial(60, 'EXTRACTOR-dtls_srtp');\n</code></pre>",
          "displayName": "DTLS-SRTP example"
        },
        {
          "textRaw": "MTU considerations",
          "name": "mtu_considerations",
          "type": "module",
          "desc": "<p>Since libuv does not currently support path MTU discovery, the DTLS module\nuses a conservative default MTU of 1200 bytes. This value works across\nvirtually all network paths but may be suboptimal for local networks.</p>\n<p>The MTU can be configured via the <code>mtu</code> option:</p>\n<pre><code class=\"language-mjs\">// For a local network where you know the path MTU\nconst endpoint = listen(callback, {\n  // ...\n  mtu: 1400,\n});\n</code></pre>\n<p>The minimum allowed MTU is 256 bytes. The maximum is 65535.</p>",
          "displayName": "MTU considerations"
        }
      ],
      "methods": [
        {
          "textRaw": "`dtls.listen(callback, options)`",
          "name": "listen",
          "type": "method",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`callback` {Function} Called for each new DTLS session accepted by the server.",
                  "name": "callback",
                  "type": "Function",
                  "desc": "Called for each new DTLS session accepted by the server.",
                  "options": [
                    {
                      "textRaw": "`session` {DTLSSession} The new session.",
                      "name": "session",
                      "type": "DTLSSession",
                      "desc": "The new session."
                    }
                  ]
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`cert` {string|Buffer} Server certificate in PEM format. **Required.**",
                      "name": "cert",
                      "type": "string|Buffer",
                      "desc": "Server certificate in PEM format. **Required.**"
                    },
                    {
                      "textRaw": "`key` {string|Buffer} Server private key in PEM format. **Required.**",
                      "name": "key",
                      "type": "string|Buffer",
                      "desc": "Server private key in PEM format. **Required.**"
                    },
                    {
                      "textRaw": "`port` {number} Port to bind to. **Required.**",
                      "name": "port",
                      "type": "number",
                      "desc": "Port to bind to. **Required.**"
                    },
                    {
                      "textRaw": "`host` {string} Address to bind to. **Default:** `'0.0.0.0'`.",
                      "name": "host",
                      "type": "string",
                      "default": "`'0.0.0.0'`",
                      "desc": "Address to bind to."
                    },
                    {
                      "textRaw": "`ca` {string|Buffer|string[]|Buffer[]} CA certificates in PEM format.",
                      "name": "ca",
                      "type": "string|Buffer|string[]|Buffer[]",
                      "desc": "CA certificates in PEM format."
                    },
                    {
                      "textRaw": "`ciphers` {string} OpenSSL cipher list string.",
                      "name": "ciphers",
                      "type": "string",
                      "desc": "OpenSSL cipher list string."
                    },
                    {
                      "textRaw": "`alpn` {string[]|Buffer} ALPN protocol names.",
                      "name": "alpn",
                      "type": "string[]|Buffer",
                      "desc": "ALPN protocol names."
                    },
                    {
                      "textRaw": "`srtp` {string} Colon-separated SRTP protection profile names (e.g., `'SRTP_AES128_CM_SHA1_80:SRTP_AEAD_AES_128_GCM'`).",
                      "name": "srtp",
                      "type": "string",
                      "desc": "Colon-separated SRTP protection profile names (e.g., `'SRTP_AES128_CM_SHA1_80:SRTP_AEAD_AES_128_GCM'`)."
                    },
                    {
                      "textRaw": "`requestCert` {boolean} Request client certificate. **Default:** `false`.",
                      "name": "requestCert",
                      "type": "boolean",
                      "default": "`false`",
                      "desc": "Request client certificate."
                    },
                    {
                      "textRaw": "`mtu` {number} Maximum transmission unit for DTLS records. **Default:** `1200`.",
                      "name": "mtu",
                      "type": "number",
                      "default": "`1200`",
                      "desc": "Maximum transmission unit for DTLS records."
                    }
                  ]
                }
              ],
              "return": {
                "textRaw": "Returns: {DTLSEndpoint}",
                "name": "return",
                "type": "DTLSEndpoint"
              }
            }
          ],
          "desc": "<p>Creates a DTLS server bound to the specified address and port. The server\nuses automatic HMAC-based cookie exchange for DoS protection.</p>\n<pre><code class=\"language-mjs\">import { listen } from 'node:dtls';\nimport { readFileSync } from 'node:fs';\n\nconst endpoint = listen((session) => {\n  session.onmessage = (data) => {\n    console.log('Received:', data.toString());\n    session.send('pong');\n  };\n\n  session.onhandshake = (protocol) => {\n    console.log('Handshake complete:', protocol);\n  };\n}, {\n  cert: readFileSync('server-cert.pem'),\n  key: readFileSync('server-key.pem'),\n  port: 4433,\n});\n\nconsole.log('DTLS server listening on', endpoint.address);\n</code></pre>"
        },
        {
          "textRaw": "`dtls.connect(host, port[, options])`",
          "name": "connect",
          "type": "method",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "signatures": [
            {
              "params": [
                {
                  "textRaw": "`host` {string} Remote host to connect to.",
                  "name": "host",
                  "type": "string",
                  "desc": "Remote host to connect to."
                },
                {
                  "textRaw": "`port` {number} Remote port to connect to.",
                  "name": "port",
                  "type": "number",
                  "desc": "Remote port to connect to."
                },
                {
                  "textRaw": "`options` {Object}",
                  "name": "options",
                  "type": "Object",
                  "options": [
                    {
                      "textRaw": "`ca` {string|Buffer|string[]|Buffer[]} CA certificates in PEM format.",
                      "name": "ca",
                      "type": "string|Buffer|string[]|Buffer[]",
                      "desc": "CA certificates in PEM format."
                    },
                    {
                      "textRaw": "`cert` {string|Buffer} Client certificate in PEM format.",
                      "name": "cert",
                      "type": "string|Buffer",
                      "desc": "Client certificate in PEM format."
                    },
                    {
                      "textRaw": "`key` {string|Buffer} Client private key in PEM format.",
                      "name": "key",
                      "type": "string|Buffer",
                      "desc": "Client private key in PEM format."
                    },
                    {
                      "textRaw": "`rejectUnauthorized` {boolean} Reject connections with unverifiable certificates. **Default:** `true`.",
                      "name": "rejectUnauthorized",
                      "type": "boolean",
                      "default": "`true`",
                      "desc": "Reject connections with unverifiable certificates."
                    },
                    {
                      "textRaw": "`bindHost` {string} Local bind address. **Default:** `'0.0.0.0'`.",
                      "name": "bindHost",
                      "type": "string",
                      "default": "`'0.0.0.0'`",
                      "desc": "Local bind address."
                    },
                    {
                      "textRaw": "`bindPort` {number} Local bind port. **Default:** `0` (ephemeral).",
                      "name": "bindPort",
                      "type": "number",
                      "default": "`0` (ephemeral)",
                      "desc": "Local bind port."
                    },
                    {
                      "textRaw": "`alpn` {string[]|Buffer} ALPN protocol names.",
                      "name": "alpn",
                      "type": "string[]|Buffer",
                      "desc": "ALPN protocol names."
                    },
                    {
                      "textRaw": "`srtp` {string} SRTP protection profile names.",
                      "name": "srtp",
                      "type": "string",
                      "desc": "SRTP protection profile names."
                    },
                    {
                      "textRaw": "`mtu` {number} Maximum transmission unit. **Default:** `1200`.",
                      "name": "mtu",
                      "type": "number",
                      "default": "`1200`",
                      "desc": "Maximum transmission unit."
                    }
                  ],
                  "optional": true
                }
              ],
              "return": {
                "textRaw": "Returns: {DTLSSession}",
                "name": "return",
                "type": "DTLSSession"
              }
            }
          ],
          "desc": "<p>Connects to a DTLS server. Returns a <code>DTLSSession</code> whose <code>opened</code> property\nis a <code>Promise</code> that resolves when the handshake completes.</p>\n<pre><code class=\"language-mjs\">import { connect } from 'node:dtls';\nimport { readFileSync } from 'node:fs';\n\nconst session = connect('localhost', 4433, {\n  ca: [readFileSync('ca-cert.pem')],\n});\n\nawait session.opened;\nsession.send('hello');\n\nsession.onmessage = (data) => {\n  console.log('Received:', data.toString());\n};\n</code></pre>"
        }
      ],
      "classes": [
        {
          "textRaw": "Class: `DTLSEndpoint`",
          "name": "DTLSEndpoint",
          "type": "class",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "desc": "<p>Manages a UDP socket and multiplexes DTLS sessions.</p>",
          "properties": [
            {
              "textRaw": "Returns: {Object} `{ address, family, port }`",
              "name": "address",
              "type": "Object",
              "desc": "<p>The local address the endpoint is bound to.</p>",
              "shortDesc": "`{ address, family, port }`"
            },
            {
              "textRaw": "Returns: {DTLSEndpointState}",
              "name": "state",
              "type": "DTLSEndpointState",
              "desc": "<p>Shared state object with properties:</p>\n<ul>\n<li><code>bound</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>listening</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>closing</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>destroyed</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n<li><code>sessionCount</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#number_type\"><code>&#x3C;number></code></a></li>\n<li><code>busy</code> <a href=\"https://developer.mozilla.org/docs/Web/JavaScript/Data_structures#boolean_type\"><code>&#x3C;boolean></code></a></li>\n</ul>"
            },
            {
              "textRaw": "Type: {DTLSEndpoint.Stats}",
              "name": "stats",
              "type": "DTLSEndpoint.Stats",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The statistics collected for this endpoint. Read only. The stats object is\nlive and updated by the C++ internals as data flows through the endpoint.</p>"
            },
            {
              "textRaw": "{boolean}",
              "name": "busy",
              "type": "boolean",
              "desc": "<p>When <code>true</code>, the endpoint rejects new incoming connections. Can be set\nto implement backpressure.</p>"
            },
            {
              "textRaw": "{Promise} Resolves when the endpoint has fully closed.",
              "name": "closed",
              "type": "Promise",
              "desc": "Resolves when the endpoint has fully closed."
            }
          ],
          "methods": [
            {
              "textRaw": "`endpoint.close()`",
              "name": "close",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Resolves when the endpoint is fully closed.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Resolves when the endpoint is fully closed."
                  }
                }
              ],
              "desc": "<p>Gracefully closes the endpoint. All active sessions are closed with\n<code>close_notify</code> alerts before the UDP socket is released.</p>"
            },
            {
              "textRaw": "`endpoint.destroy([error])`",
              "name": "destroy",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "error",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Immediately destroys the endpoint without sending <code>close_notify</code> alerts.</p>"
            },
            {
              "textRaw": "`endpoint[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Equivalent to calling <code>endpoint.close()</code>.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `DTLSEndpoint.Stats`",
          "name": "DTLSEndpoint.Stats",
          "type": "class",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "desc": "<p>A view of the collected statistics for an endpoint.</p>",
          "properties": [
            {
              "textRaw": "Type: {bigint} A timestamp indicating when the endpoint was created. Read only.",
              "name": "createdAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating when the endpoint was created. Read only."
            },
            {
              "textRaw": "Type: {bigint} A timestamp indicating when the endpoint was destroyed. Read only.",
              "name": "destroyedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating when the endpoint was destroyed. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of bytes received by this endpoint. Read only.",
              "name": "bytesReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of bytes received by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of bytes sent by this endpoint. Read only.",
              "name": "bytesSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of bytes sent by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of UDP packets received by this endpoint. Read only.",
              "name": "packetsReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of UDP packets received by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of UDP packets sent by this endpoint. Read only.",
              "name": "packetsSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of UDP packets sent by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of peer-initiated sessions accepted by this endpoint. Read only.",
              "name": "serverSessions",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of peer-initiated sessions accepted by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of sessions initiated by this endpoint. Read only.",
              "name": "clientSessions",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of sessions initiated by this endpoint. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of incoming connections rejected because the endpoint was marked busy. Read only.",
              "name": "serverBusyCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of incoming connections rejected because the endpoint was marked busy. Read only."
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "isConnected",
              "type": "boolean",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p><code>true</code> if the stats object is still connected to the underlying endpoint.\nOnce the endpoint is destroyed, the stats become a stale snapshot.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `DTLSSession`",
          "name": "DTLSSession",
          "type": "class",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "desc": "<p>Represents a DTLS association with a single remote peer.</p>",
          "methods": [
            {
              "textRaw": "`session.send(data)`",
              "name": "send",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`data` {string|Buffer} The data to send.",
                      "name": "data",
                      "type": "string|Buffer",
                      "desc": "The data to send."
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {number} The number of bytes written to the DTLS layer.",
                    "name": "return",
                    "type": "number",
                    "desc": "The number of bytes written to the DTLS layer."
                  }
                }
              ],
              "desc": "<p>Send application data to the peer. The data is encrypted by DTLS before\nbeing sent over UDP. Can only be called after the handshake completes\n(<code>session.opened</code> has resolved).</p>"
            },
            {
              "textRaw": "`session.close()`",
              "name": "close",
              "type": "method",
              "signatures": [
                {
                  "params": [],
                  "return": {
                    "textRaw": "Returns: {Promise} Resolves when the session is closed.",
                    "name": "return",
                    "type": "Promise",
                    "desc": "Resolves when the session is closed."
                  }
                }
              ],
              "desc": "<p>Initiates a graceful DTLS shutdown by sending a <code>close_notify</code> alert.</p>"
            },
            {
              "textRaw": "`session.destroy([error])`",
              "name": "destroy",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "name": "error",
                      "optional": true
                    }
                  ]
                }
              ],
              "desc": "<p>Immediately destroys the session without sending <code>close_notify</code>.</p>"
            },
            {
              "textRaw": "`session.exportKeyingMaterial(length, label[, context])`",
              "name": "exportKeyingMaterial",
              "type": "method",
              "signatures": [
                {
                  "params": [
                    {
                      "textRaw": "`length` {number} Number of bytes to export.",
                      "name": "length",
                      "type": "number",
                      "desc": "Number of bytes to export."
                    },
                    {
                      "textRaw": "`label` {string} The label for the exported keying material.",
                      "name": "label",
                      "type": "string",
                      "desc": "The label for the exported keying material."
                    },
                    {
                      "textRaw": "`context` {Buffer} Optional context value.",
                      "name": "context",
                      "type": "Buffer",
                      "desc": "Optional context value.",
                      "optional": true
                    }
                  ],
                  "return": {
                    "textRaw": "Returns: {Buffer}",
                    "name": "return",
                    "type": "Buffer"
                  }
                }
              ],
              "desc": "<p>Exports keying material from the DTLS session, as defined in\n<a href=\"https://www.rfc-editor.org/rfc/rfc5705\">RFC 5705</a>. This is commonly used with DTLS-SRTP to derive\nencryption keys for media streams.</p>"
            }
          ],
          "properties": [
            {
              "textRaw": "{Promise} Resolves with `{ protocol }` when the DTLS handshake completes.",
              "name": "opened",
              "type": "Promise",
              "desc": "Resolves with `{ protocol }` when the DTLS handshake completes."
            },
            {
              "textRaw": "{Promise} Resolves when the session is fully closed.",
              "name": "closed",
              "type": "Promise",
              "desc": "Resolves when the session is fully closed."
            },
            {
              "textRaw": "Returns: {Object} `{ address, family, port }`",
              "name": "remoteAddress",
              "type": "Object",
              "desc": "`{ address, family, port }`"
            },
            {
              "textRaw": "Returns: {string} The negotiated DTLS protocol version (e.g., `'DTLSv1.2'`).",
              "name": "protocol",
              "type": "string",
              "desc": "The negotiated DTLS protocol version (e.g., `'DTLSv1.2'`)."
            },
            {
              "textRaw": "Returns: {Object} `{ name, standardName, version }`",
              "name": "cipher",
              "type": "Object",
              "desc": "`{ name, standardName, version }`"
            },
            {
              "textRaw": "Returns: {string|undefined} The peer's certificate in PEM format.",
              "name": "peerCertificate",
              "type": "string|undefined",
              "desc": "The peer's certificate in PEM format."
            },
            {
              "textRaw": "Returns: {string|undefined} The negotiated ALPN protocol.",
              "name": "alpnProtocol",
              "type": "string|undefined",
              "desc": "The negotiated ALPN protocol."
            },
            {
              "textRaw": "Returns: {string|undefined} The negotiated SRTP protection profile name.",
              "name": "srtpProfile",
              "type": "string|undefined",
              "desc": "The negotiated SRTP protection profile name."
            },
            {
              "textRaw": "Type: {DTLSSession.Stats}",
              "name": "stats",
              "type": "DTLSSession.Stats",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p>The statistics collected for this session. Read only. The stats object is\nlive and updated as data flows through the session.</p>"
            }
          ]
        },
        {
          "textRaw": "Class: `DTLSSession.Stats`",
          "name": "DTLSSession.Stats",
          "type": "class",
          "meta": {
            "added": [
              "REPLACEME"
            ],
            "changes": []
          },
          "desc": "<p>A view of the collected statistics for a session.</p>",
          "properties": [
            {
              "textRaw": "Type: {bigint} A timestamp indicating when the session was created. Read only.",
              "name": "createdAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating when the session was created. Read only."
            },
            {
              "textRaw": "Type: {bigint} A timestamp indicating when the session was destroyed. Read only.",
              "name": "destroyedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating when the session was destroyed. Read only."
            },
            {
              "textRaw": "Type: {bigint} A timestamp indicating when `close()` was called. Read only.",
              "name": "closingAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating when `close()` was called. Read only."
            },
            {
              "textRaw": "Type: {bigint} A timestamp indicating when the DTLS handshake completed. Read only.",
              "name": "handshakeCompletedAt",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "A timestamp indicating when the DTLS handshake completed. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of application data bytes received. Read only.",
              "name": "bytesReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of application data bytes received. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of application data bytes sent. Read only.",
              "name": "bytesSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of application data bytes sent. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of application messages received. Read only.",
              "name": "messagesReceived",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of application messages received. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of application messages sent. Read only.",
              "name": "messagesSent",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of application messages sent. Read only."
            },
            {
              "textRaw": "Type: {bigint} The total number of DTLS handshake retransmissions. Read only.",
              "name": "retransmitCount",
              "type": "bigint",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "The total number of DTLS handshake retransmissions. Read only."
            },
            {
              "textRaw": "Type: {boolean}",
              "name": "isConnected",
              "type": "boolean",
              "meta": {
                "added": [
                  "REPLACEME"
                ],
                "changes": []
              },
              "desc": "<p><code>true</code> if the stats object is still connected to the underlying session.\nOnce the session is destroyed, the stats become a stale snapshot.</p>"
            }
          ],
          "modules": [
            {
              "textRaw": "Callback properties",
              "name": "callback_properties",
              "type": "module",
              "properties": [
                {
                  "textRaw": "{Function}",
                  "name": "onmessage",
                  "type": "Function",
                  "desc": "<p>Set to receive application data from the peer.</p>",
                  "options": [
                    {
                      "textRaw": "`data` {Buffer}",
                      "name": "data",
                      "type": "Buffer"
                    }
                  ]
                },
                {
                  "textRaw": "{Function}",
                  "name": "onerror",
                  "type": "Function",
                  "desc": "<p>Set to receive error notifications.</p>",
                  "options": [
                    {
                      "textRaw": "`error` {Error}",
                      "name": "error",
                      "type": "Error"
                    }
                  ]
                },
                {
                  "textRaw": "{Function}",
                  "name": "onhandshake",
                  "type": "Function",
                  "desc": "<p>Set to receive handshake completion notifications.</p>",
                  "options": [
                    {
                      "textRaw": "`protocol` {string}",
                      "name": "protocol",
                      "type": "string"
                    }
                  ]
                },
                {
                  "textRaw": "{Function}",
                  "name": "onkeylog",
                  "type": "Function",
                  "desc": "<p>Set to receive TLS key log lines (for debugging with Wireshark).</p>",
                  "options": [
                    {
                      "textRaw": "`line` {string}",
                      "name": "line",
                      "type": "string"
                    }
                  ]
                }
              ],
              "displayName": "Callback properties"
            }
          ],
          "methods": [
            {
              "textRaw": "`session[Symbol.asyncDispose]()`",
              "name": "[Symbol.asyncDispose]",
              "type": "method",
              "signatures": [
                {
                  "params": []
                }
              ],
              "desc": "<p>Equivalent to calling <code>session.close()</code>.</p>"
            }
          ]
        }
      ],
      "displayName": "DTLS"
    }
  ]
}