Cannot use Connector with SQL Server if SSL is enforced
维护者通常 1 天内回复
评估
这个 Issue 还没有评估数据。
描述
Bug Description
I guess this should be considered a bug. I know that we do not need to enforce SSL when using a Connector, since it handles secure connection for us. However, on the other hand, with PostgreSQL and MySQL, we can use Connector even when SSL is enforced, so this makes SQL Server an exception where it doesn't work.
I know that Connector returns tedious options with encrypt: false so that connection is not double-encrypted. But perhaps there should be a way for tedious to know that we are already passing secure connection.
Example code
import { AuthTypes, Connector, IpAddressTypes } from '@google-cloud/cloud-sql-connector'
import knex from 'knex'
const clientOpts = await connector.getTediousOptions({
instanceConnectionName: 'my-project.my-region.my-instance',
ipType: IpAddressTypes.PUBLIC,
authType: AuthTypes.PASSWORD,
})
const database = knex({
client: 'mssql',
connection: {
server: '0.0.0.0', # dummy value due to a bug
user: 'user',
password: 'password',
database: 'database',
options: {
...clientOpts,
},
}
})
const result = await database.first(database.raw(`'True' AS connected`))
Stacktrace
ConnectionError: Server requires encryption, set 'encrypt' config option to true.
at /project/node_modules/tedious/src/connection.ts:3251:34
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
code: 'EENCRYPT',
isTransient: undefined
}
How to reproduce
- Create Cloud SQL Server instance.
- Check "Allow only SSL connections" checkbox.
- Connect using above example.
Environment details
- OS: MacOS 11.6
- Node.js version: v18.18.0
- npm version: v9.8.1
- connector version: 1.0.0
- tedious version: 16.4.0
- 主要语言
- TypeScript
- 星标
- 99
- 派生
- 18
- 平均合并
- 1 天 23 小时
- 30 天内合并 PR
- 20
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
GoogleCloudPlatform/cloud-sql-nodejs-connector 的其他 Issue
-
flakybot: issue priority: p2 type: bug
难度 2/5 1-3 小时 新手友好度 72/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#658 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#656 ·
维护者通常 1 天内回复
-
flakybot: flaky flakybot: issue priority: p2 type: bug
难度 4/5 3-5 天 新手友好度 48/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#657 · 1 条评论 ·
维护者通常 1 天内回复
-
Cloud Build Failure Reporter: node-integration-test-nightly (cloud-sql-connector-testing) failed未关闭
难度 3/5 1-2 天 新手友好度 45/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#641 ·
维护者通常 1 天内回复
-
难度 3/5 半天 新手友好度 35/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#634 · 1 个 reaction ·
维护者通常 1 天内回复
查看 GoogleCloudPlatform/cloud-sql-nodejs-connector 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
Bug
难度 2/5 1-3 小时 新手友好度 82/100
-
bug P3
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 64/100
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复