列出客户端在 Nodejs 中支持的所有 TLS 密码 [英] List all TLS Ciphers the Client supports in Nodejs
本文介绍了列出客户端在 Nodejs 中支持的所有 TLS 密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用以下代码运行的简单 Nodejs 服务器:
I have a simple Nodejs server running with the following code:
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()
获取用于当前连接的密码.
I know that I can get the cipher used for the current connection using request.socket.getCipher()
.
如何获取客户端在 ClientHello
消息中发送的所有密码列表?
我更喜欢 Nodejs 解决方案,而不使用像 tshark
或 tcpdump
这样的外部工具.
How do I get a list of all the Ciphers that the client sends in the ClientHello
message?
I would prefer a Nodejs solution, without using external tools like tshark
or tcpdump
.
感谢您抽出宝贵时间.
推荐答案
您可以使用 request.socket.getSharedSigalgs()
这篇关于列出客户端在 Nodejs 中支持的所有 TLS 密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文