ObjectSslHandler
sslprotocol conversion processor
to transform the data stream intosslstreaming protocol. SslHandler is rightSslSocketA package for building servers, logically equivalent to:
1
2
3
4
5
6
7var ss = new ssl.Socket(crt, key);
function(s) {
var s1 = ss.accept(s);
hdlr.invoke(s1);
s1.close();
}
inheritance relationship
Constructor
SslHandler
SslHandler constructor, create a new SslHandler object
1
2new 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, seemq.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, create a new SslHandler object
1
2
3new SslHandler(X509Cert crt,
PKey key,
Handler hdlr);
Call parameters:
- crt:X509Cert,X509CertCertificate, used by client to authenticate server
- key:PKey,PKeyprivate key, used to talk to the client
- hdlr:Handler, built-in message processor, processing function, chain processing array, routing object, seemq.Handler
member attribute
verification
Integer, set the certificate verification mode, the default is VERIFY_NONE
1Integer SslHandler.verification;
ca
X509Cert, the client certificate verifies the certificate chain
1readonly X509Cert SslHandler.ca;
handler
Handler,sslProtocol conversion processor current event processing interface object
1Handler SslHandler.handler;
member function
invoke
process a message or object
1Handler SslHandler.invoke(object v) async;
Call parameters:
- v:object, specifies the message or object to process
return result:
- Handler, returns the handler for the next step
toString
Return the string representation of the object, generally return "[Native Object]", the object can be reimplemented according to its own characteristics
1String SslHandler.toString();
return result:
- String, returns a string representation of the object
toJSON
Returns the JSON format representation of the object, generally returns a collection of readable properties defined by the object
1Value SslHandler.toJSON(String key = "");
Call parameters:
- key: String, not used
return result:
- Value, which returns a JSON-serializable value