Object built-in object

Object SslHandler

ssl protocol conversion processor

Used to convert the data stream to the ssl stream protocol. SslHandler is an encapsulation of SslSocket , used to build a server, 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

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 handler, processing function, chain processing array, routing object, see mq.Handler details

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, used for client authentication server
  • key : PKey , PKey private key, used to talk to the client
  • hdlr : Handler , built-in message handler, processing function, chain processing array, routing object, see mq.Handler details

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