tls.getCiphers()


返回包含支持的 TLS 密码名称的数组。 由于历史原因,名称为小写,但必须大写才能在 tls.createSecureContext()ciphers 选项中使用。

'tls_' 开头的密码名称适用于 TLSv1.3,所有其他密码均适用于 TLSv1.2 及以下。

console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...]

Returns an array with the names of the supported TLS ciphers. The names are lower-case for historical reasons, but must be uppercased to be used in the ciphers option of tls.createSecureContext().

Cipher names that start with 'tls_' are for TLSv1.3, all the others are for TLSv1.2 and below.

console.log(tls.getCiphers()); // ['aes128-gcm-sha256', 'aes128-sha', ...]