Beispiel #1
0
        cert: "SOME CERTIFICATE",
    });
    const blah = ctx.context;

    const connOpts: ConnectionOptions = {
        host: "127.0.0.1",
        port: 55
    };
    const tlsSocket = connect(connOpts);

    const ciphers: string[] = getCiphers();
    const curve: string = DEFAULT_ECDH_CURVE;
}

{
    const _server = createServer();

    _server.addContext("example", {
        cert: fs.readFileSync("cert_filepath"),
        key: fs.readFileSync("key_filepath")
    });
}

{
    let _server = createServer({});
    let _boolean: boolean;
    const _func1 = (err: Error, resp: Buffer) => { };
    const _func2 = (err: Error, sessionData: Buffer) => { };
    /**
     * events.EventEmitter
     * 1. tlsClientError
Beispiel #2
0
        cert: "SOME CERTIFICATE",
    });
    const blah = ctx.context;

    const connOpts: ConnectionOptions = {
        host: "127.0.0.1",
        port: 55
    };
    const tlsSocket = connect(connOpts);

    const ciphers: string[] = getCiphers();
    const curve: string = DEFAULT_ECDH_CURVE;
}

{
    let _server = createServer({});
    let _boolean: boolean;
    const _func1 = (err: Error, resp: Buffer) => { };
    const _func2 = (err: Error, sessionData: Buffer) => { };
    /**
     * events.EventEmitter
     * 1. tlsClientError
     * 2. newSession
     * 3. OCSPRequest
     * 4. resumeSession
     * 5. secureConnection
     */

    _server = _server.addListener("tlsClientError", (err, tlsSocket) => {
        const _err: Error = err;
        const _tlsSocket: TLSSocket = tlsSocket;