Object built-in object

ObjectSslHandler

sslprotocol conversion processor

used to convert the data stream intosslstreaming protocol. SslHandler is rightSslSocketEncapsulation, used to build servers, 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, creates a new SslHandler object

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

Call parameters:

  • certs: Array, list of server certificates
  • hdlr:Handler, built-in message processor, processing function, chain processing array, routing object, see detailsmq.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, creates a new SslHandler object

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

Call parameters:

  • crt:X509Cert,X509CertCertificate, used by clients to authenticate servers
  • key:PKey,PKeyPrivate key, used to talk to the client
  • hdlr:Handler, built-in message processor, processing function, chain processing array, routing object, see detailsmq.Handler

member properties

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,sslProtocol 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 results:

  • Handler, return to the next processor

toString

Returns the string representation of the object. Generally, "[Native Object]" is returned. The object can be re-implemented according to its own characteristics.

1
String SslHandler.toString();

Return results:

  • String, returns the string representation of the object

toJSON

Returns a JSON format representation of the object, generally returning a collection of readable properties defined by the object.

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

Call parameters:

  • key: String, not used

Return results:

  • Value, returns a value containing JSON serializable