Object built-in object

Object SslHandler

ssl Protocol conversion processor

To convert the data stream into sslStreaming protocol. SslHandler is rightSslSocket The package, used to build the server, is logically equivalent to:

1 2 3 4 5 6 7
var ss = new ssl.Socket(crt, key); function(s) { var s1 = ss.accept(s); hdlr.invoke(s1); s1.close(); }

Inheritance relationship

Constructor

SslHandler

SslHandler constructor to create a new SslHandler object

1 2
new SslHandler(Array certs, Handler hdlr);

Call parameters:

  • certs: Array, server certificate list
  • hdlr: Handler, Built-in message processor, processing function, chain processing array, routing object, see details mq.Handler

The format of certs is:

1 2 3 4 5 6 7 8 9 10 11
[{ name: "fibjs.org", crt: [X509Cert object], key: [PKey object] }, { name: "*.fibjs.org", crt: [X509Cert object], key: [PKey object] } ]

SslHandler constructor to create a new SslHandler object

1 2 3
new SslHandler(X509Cert crt, PKey key, Handler hdlr);

Call parameters:

  • crt: X509Cert, X509Cert Certificate for client authentication server
  • key: PKey, PKey Private key, used to talk to the client
  • hdlr: Handler, Built-in message processor, processing function, chain processing array, routing object, see details mq.Handler

Member attributes

verification

Integer, set the certificate verification mode, the default is VERIFY_NONE

1
Integer SslHandler.verification;

ca

X509Cert, Client certificate verification certificate chain

1
readonly X509Cert SslHandler.ca;

handler

Handler, ssl Protocol conversion processor current event processing interface object

1
Handler SslHandler.handler;

Member function

invoke

Process a message or object

1
Handler SslHandler.invoke(object v) async;

Call parameters:

  • v: object, Specify the message or object to be processed

Return result:

  • Handler, Return to the next processor

toString

Returns the string representation of the object, generally returns "[Native Object]", the object can be re-implemented according to its own characteristics

1
String SslHandler.toString();

Return result:

  • String, Returns the string representation of the object

toJSON

Returns the JSON format representation of the object, generally returns a collection of readable attributes defined by the object

1
Value SslHandler.toJSON(String key = "");

Call parameters:

  • key: String, unused

Return result:

  • Value, Returns a value containing JSON serializable