javascript - 如何验证nodejs应用程序中的mssql连接是否加密?
问题描述
我们知道,通过给出以下配置,我们可以使用“mssql”包在 nodejs 应用程序中创建加密连接。
const configDB = {
server: ServerName,
user: USER_ID,
password: pwd,
database: DatabaseName,
port: SQL_PORT,
pool: {
min: 1,
max: 10
},
options: {
encrypt: true
}
};
给出的 encrypt:true 选项向我们保证连接将被加密。但是有没有办法验证连接是否加密?
解决方案
运行此查询以检查当前连接是否已加密:
select encrypt_option
from sys.dm_exec_connections
where session_id = @@spid
推荐阅读
- mongodb - Mongodb:连接被拒绝
- ios - 适用于所有 iPhone 设备的图像调整器
- javascript - JavaScript为数组中不存在的键添加零
- python - 我在使用 Telepot 运行 Telegram Bot 时遇到问题
- python - python lockf:LOCK_EX 有效,但 LOCK_SH 无效
- redux - combineReducers 破坏了简单的单元测试?初始状态行为已更改
- c - 如何将相同长度的两个数组中的公共值复制到另一个没有重复的数组中?
- oracle11g - 有没有办法将列名作为日期的csv导入oracle?
- java - 嵌入式的休眠延迟加载字段
- c - 在 A 行和 B 行输出?