Cannot use Connector with SQL Server if SSL is enforced
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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
- Vorherrschende Sprache
- TypeScript
- Sterne
- 99
- Forks
- 18
- Ø Merge
- 1 T. 23 Std.
- Gemergte PRs (30 T.)
- 20
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus GoogleCloudPlatform/cloud-sql-nodejs-connector
-
flakybot: issue priority: p2 type: bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#658 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#656 ·
Maintainer antworten meist innerhalb von 1 Tag
-
flakybot: flaky flakybot: issue priority: p2 type: bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#657 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Cloud Build Failure Reporter: node-integration-test-nightly (cloud-sql-connector-testing) failedOffen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#641 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 35/100
GoogleCloudPlatform/cloud-sql-nodejs-connector#634 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in GoogleCloudPlatform/cloud-sql-nodejs-connector
Ähnliche Issues
-
feature
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Team (channel) avatars render noticeably smaller than agent avatars in the sidebar gridOffenbug from-app needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
nightly-labs/openbot#21303 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ADORSYS-GIS/CoopData#282 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
OHDSI/Data2Evidence#3816 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
`ovsx verify` fails for a version older than the 100 newest of an extensionEvtl. vergeben @trivikr hat das heute übernommen. Offencli
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 81/100
eclipse-openvsx/openvsx#2482 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag