【问题标题】:List all TLS Ciphers the Client supports in Nodejs列出客户端在 Nodejs 中支持的所有 TLS 密码
【发布时间】:2020-04-23 22:13:25
【问题描述】:

我有一个使用以下代码运行的简单 Nodejs 服务器:

const https = require("http2");
const fs = require("fs");

const PORT = 443;

let server = https.createSecureServer({
    allowHTTP1: true,
    key:  fs.readFileSync("./key.pem"),
    cert: fs.readFileSync("./cert.pem")
});

server.on("error", console.log);

server.on("request", (request, response) => {
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.end("Hello, World", "utf-8");
});

我知道我可以使用request.socket.getCipher() 获取用于当前连接的密码。

如何获取客户端在ClientHello 消息中发送的所有密码列表?
我更喜欢 Nodejs 解决方案,而不使用像 tsharktcpdump 这样的外部工具。

感谢您的宝贵时间。

【问题讨论】:

    标签: node.js tls1.2


    【解决方案1】:

    您可以使用request.socket.getSharedSigalgs()

    【讨论】:

    • 谢谢!这正是我想要的。
    猜你喜欢
    • 1970-01-01
    • 2023-02-04
    • 2014-08-22
    • 1970-01-01
    • 2012-07-23
    • 1970-01-01
    • 2021-05-09
    • 2018-09-22
    • 2015-06-19
    相关资源
    最近更新 更多