Cannot use Connector with SQL Server if SSL is enforced
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 99
- Fork
- 18
- Merge trung bình
- 1 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 20
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GoogleCloudPlatform/cloud-sql-nodejs-connector
-
flakybot: issue priority: p2 type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#658 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#656 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
flakybot: flaky flakybot: issue priority: p2 type: bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#657 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Cloud Build Failure Reporter: node-integration-test-nightly (cloud-sql-connector-testing) failedĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#641 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 35/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#634 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của GoogleCloudPlatform/cloud-sql-nodejs-connector
Issue tương tự
-
combobox: highlighted item never scrolls into view when there's no content part (Ark Command)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
bug P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày