class TLSSocket extends Object with StObject

Annotations
@JSType() @JSImport("tls", "TLSSocket") @native()
Source
TLSSocket.scala
Linear Supertypes
StObject, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TLSSocket
  2. StObject
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new TLSSocket(socket: Socket, options: TLSSocketOptions)
  2. new TLSSocket(socket: Socket)

    Construct a new tls.TLSSocket object from an existing TCP socket.

  3. new TLSSocket()
    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addListener(event: scala.Predef.String, listener: Function1[Any, Unit]): TLSSocket.this.type
  5. def addListener_OCSPResponse(event: OCSPResponse, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("addListener")
  6. def addListener_keylog(event: keylog, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("addListener")
  7. def addListener_secureConnect(event: secureConnect, listener: Function0[Unit]): TLSSocket.this.type
    Annotations
    @JSName("addListener")
  8. def addListener_session(event: session, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("addListener")
  9. var alpnProtocol: UndefOr[scala.Predef.String]

    String containing the selected ALPN protocol.

    String containing the selected ALPN protocol. When ALPN has no selected protocol, tlsSocket.alpnProtocol equals false.

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. var authorizationError: Error

    The reason why the peer's certificate has not been verified.

    The reason why the peer's certificate has not been verified. This property becomes available only when tlsSocket.authorized === false.

  12. var authorized: Boolean

    A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.

  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  14. def disableRenegotiation(): Unit

    Disables TLS renegotiation for this TLSSocket instance.

    Disables TLS renegotiation for this TLSSocket instance. Once called, attempts to renegotiate will trigger an 'error' event on the TLSSocket.

  15. def emit(event: Symbol, args: Any*): Boolean
  16. def emit(event: scala.Predef.String, args: Any*): Boolean
  17. def emit_OCSPResponse(event: OCSPResponse, response: Buffer): Boolean
    Annotations
    @JSName("emit")
  18. def emit_keylog(event: keylog, line: Buffer): Boolean
    Annotations
    @JSName("emit")
  19. def emit_secureConnect(event: secureConnect): Boolean
    Annotations
    @JSName("emit")
  20. def emit_session(event: session, session: Buffer): Boolean
    Annotations
    @JSName("emit")
  21. def enableTrace(): Unit

    When enabled, TLS packet trace information is written to stderr.

    When enabled, TLS packet trace information is written to stderr. This can be used to debug TLS connection problems.

    Note: The format of the output is identical to the output of openssl s_client -trace or openssl s_server -trace. While it is produced by OpenSSL's SSL_trace() function, the format is undocumented, can change without notice, and should not be relied on.

  22. var encrypted: Boolean

    Static boolean value, always true.

    Static boolean value, always true. May be used to distinguish TLS sockets from regular ones.

  23. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  25. def exportKeyingMaterial(length: Double, label: scala.Predef.String, context: Buffer): Buffer

    length

    number of bytes to retrieve from keying material

    label

    an application specific label, typically this will be a value from the [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).

    context

    optionally provide a context.

  26. def getCertificate(): |[|[PeerCertificate, Object], Null]

    Returns an object representing the local certificate.

    Returns an object representing the local certificate. The returned object has some properties corresponding to the fields of the certificate.

    See tls.TLSSocket.getPeerCertificate() for an example of the certificate structure.

    If there is no local certificate, an empty object will be returned. If the socket has been destroyed, null will be returned.

  27. def getCipher(): CipherNameAndProtocol

    Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.

  28. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  29. def getEphemeralKeyInfo(): |[|[EphemeralKeyInfo, Object], Null]

    Returns an object representing the type, name, and size of parameter of an ephemeral key exchange in Perfect Forward Secrecy on a client connection.

    Returns an object representing the type, name, and size of parameter of an ephemeral key exchange in Perfect Forward Secrecy on a client connection. It returns an empty object when the key exchange is not ephemeral. As this is only supported on a client socket; null is returned if called on a server socket. The supported types are 'DH' and 'ECDH'. The name property is available only when type is 'ECDH'.

    For example: { type: 'ECDH', name: 'prime256v1', size: 256 }.

  30. def getFinished(): UndefOr[Buffer]

    Returns the latest Finished message that has been sent to the socket as part of a SSL/TLS handshake, or undefined if no Finished message has been sent yet.

    Returns the latest Finished message that has been sent to the socket as part of a SSL/TLS handshake, or undefined if no Finished message has been sent yet.

    As the Finished messages are message digests of the complete handshake (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can be used for external authentication procedures when the authentication provided by SSL/TLS is not desired or is not enough.

    Corresponds to the SSL_get_finished routine in OpenSSL and may be used to implement the tls-unique channel binding from RFC 5929.

  31. def getPeerCertificate(detailed: Boolean): |[PeerCertificate, DetailedPeerCertificate]
  32. def getPeerCertificate(): |[PeerCertificate, DetailedPeerCertificate]
  33. def getPeerCertificate_PeerCertificate(): PeerCertificate
    Annotations
    @JSName("getPeerCertificate")
  34. def getPeerCertificate_false(detailed: false): PeerCertificate
    Annotations
    @JSName("getPeerCertificate")
  35. def getPeerCertificate_true(detailed: true): DetailedPeerCertificate

    Returns an object representing the peer's certificate.

    Returns an object representing the peer's certificate. The returned object has some properties corresponding to the field of the certificate. If detailed argument is true the full chain with issuer property will be returned, if false only the top certificate without issuer property. If the peer does not provide a certificate, it returns null or an empty object.

    detailed

    - If true; the full chain with issuer property will be returned.

    Annotations
    @JSName("getPeerCertificate")
  36. def getPeerFinished(): UndefOr[Buffer]

    Returns the latest Finished message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or undefined if there is no Finished message so far.

    Returns the latest Finished message that is expected or has actually been received from the socket as part of a SSL/TLS handshake, or undefined if there is no Finished message so far.

    As the Finished messages are message digests of the complete handshake (with a total of 192 bits for TLS 1.0 and more for SSL 3.0), they can be used for external authentication procedures when the authentication provided by SSL/TLS is not desired or is not enough.

    Corresponds to the SSL_get_peer_finished routine in OpenSSL and may be used to implement the tls-unique channel binding from RFC 5929.

  37. def getPeerX509Certificate(): UndefOr[X509Certificate]

    If there is no peer certificate, or the socket has been destroyed, undefined will be returned.

  38. def getProtocol(): |[scala.Predef.String, Null]

    Returns a string containing the negotiated SSL/TLS protocol version of the current connection.

    Returns a string containing the negotiated SSL/TLS protocol version of the current connection. The value 'unknown' will be returned for connected sockets that have not completed the handshaking process. The value null will be returned for server sockets or disconnected client sockets. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_get_version.html for more information.

  39. def getSession(): UndefOr[Buffer]

    Could be used to speed up handshake establishment when reconnecting to the server.

  40. def getSharedSigalgs(): Array[scala.Predef.String]

    Returns a list of signature algorithms shared between the server and the client in the order of decreasing preference.

  41. def getTLSTicket(): UndefOr[Buffer]

    NOTE: Works only with client TLS sockets.

    NOTE: Works only with client TLS sockets. Useful only for debugging, for session reuse provide session option to tls.connect().

  42. def getX509Certificate(): UndefOr[X509Certificate]

    If there is no local certificate, or the socket has been destroyed, undefined will be returned.

  43. def hasOwnProperty(v: scala.Predef.String): Boolean
    Definition Classes
    Object
  44. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  45. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  46. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  47. def isSessionReused(): Boolean

    Returns true if the session was reused, false otherwise.

  48. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  49. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  50. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  51. def on(event: scala.Predef.String, listener: Function1[Any, Unit]): TLSSocket.this.type
  52. def on_OCSPResponse(event: OCSPResponse, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("on")
  53. def on_keylog(event: keylog, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("on")
  54. def on_secureConnect(event: secureConnect, listener: Function0[Unit]): TLSSocket.this.type
    Annotations
    @JSName("on")
  55. def on_session(event: session, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("on")
  56. def once(event: scala.Predef.String, listener: Function1[Any, Unit]): TLSSocket.this.type
  57. def once_OCSPResponse(event: OCSPResponse, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("once")
  58. def once_keylog(event: keylog, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("once")
  59. def once_secureConnect(event: secureConnect, listener: Function0[Unit]): TLSSocket.this.type
    Annotations
    @JSName("once")
  60. def once_session(event: session, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("once")
  61. def prependListener(event: scala.Predef.String, listener: Function1[Any, Unit]): TLSSocket.this.type
  62. def prependListener_OCSPResponse(event: OCSPResponse, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependListener")
  63. def prependListener_keylog(event: keylog, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependListener")
  64. def prependListener_secureConnect(event: secureConnect, listener: Function0[Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependListener")
  65. def prependListener_session(event: session, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependListener")
  66. def prependOnceListener(event: scala.Predef.String, listener: Function1[Any, Unit]): TLSSocket.this.type
  67. def prependOnceListener_OCSPResponse(event: OCSPResponse, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependOnceListener")
  68. def prependOnceListener_keylog(event: keylog, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependOnceListener")
  69. def prependOnceListener_secureConnect(event: secureConnect, listener: Function0[Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependOnceListener")
  70. def prependOnceListener_session(event: session, listener: Function1[Buffer, Unit]): TLSSocket.this.type
    Annotations
    @JSName("prependOnceListener")
  71. def propertyIsEnumerable(v: scala.Predef.String): Boolean
    Definition Classes
    Object
  72. def renegotiate(options: RejectUnauthorized, callback: Function1[|[Error, Null], Unit]): UndefOr[Boolean]

    Initiate TLS renegotiation process.

    Initiate TLS renegotiation process.

    NOTE: Can be used to request peer's certificate after the secure connection has been established. ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout.

    options

    - The options may contain the following fields: rejectUnauthorized, requestCert (See tls.createServer() for details).

    callback

    - callback(err) will be executed with null as err, once the renegotiation is successfully completed.

    returns

    undefined when socket is destroy, false if negotiaion can't be initiated.

  73. def setMaxSendFragment(size: Double): Boolean

    Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).

    Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512). Smaller fragment size decreases buffering latency on the client: large fragments are buffered by the TLS layer until the entire fragment is received and its integrity is verified; large fragments can span multiple roundtrips, and their processing can be delayed due to packet loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead, which may decrease overall server throughput.

    size

    - TLS fragment size (default and maximum value is: 16384, minimum is: 512).

  74. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  75. def toLocaleString(): scala.Predef.String
    Definition Classes
    Object
  76. def toString(): java.lang.String
    Definition Classes
    AnyRef → Any
  77. def valueOf(): Any
    Definition Classes
    Object
  78. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  79. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  80. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from StObject

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped