ConnectionError using mssql package version 7.1.x
AcidSlide-Octal opened this issue · comments
I'm submitting a...
[ ] Regression
[X] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Runtime error when using mssql package 7.1.x (7.1.3 is the current latest as of 20210620)
ConnectionError: Failed to connect to localhost:1433 - self signed certificate
ConnectionError: Failed to connect to localhost:1433 - self signed certificate
at <project_folder>/node_modules/mssql/lib/tedious/connection-pool.js:71:17
at Connection.onConnect (<project_folder>/node_modules/tedious/lib/connection.js:1027:9)
at Object.onceWrapper (events.js:421:26)
at Connection.emit (events.js:314:20)
at Connection.emit (<project_folder>/node_modules/tedious/lib/connection.js:1055:18)
at Connection.socketError (<project_folder>/node_modules/tedious/lib/connection.js:1653:12)
at Socket.<anonymous> (<project_folder>/node_modules/tedious/lib/connection.js:1417:14)
Expected behavior
No correction error
Please note this is/was working in mssql package 6.3.x (with the last version at 6.3.2)
Minimal reproduction of the problem with instructions
- Install 'npm install mssql@latest'
- Run application
I've also created a Issue Ticket with Typeorm github: typeorm/typeorm#7769
Because i'm not sure if this just NestJS-Typeorm issue or issue with the main Typeorm package
What is the motivation / use case for changing the behavior?
Possible issue on config setup on typeorm
Environment
OS Version : macOS Big Sur
NodeJS Version : v12.20.1
NPM Version : 7.18.1
Typescript: 4.3.4
Nest Version : 7.6.0
The nest package is a simple wrapper around TypeORM. Or adds no direct functionality to the database connections, just sets up the di providers so nest can do injection with TypeORM constructs.
It’s strange you get a self signed certificate error on localhost. Though you can try setting the env variable NODE_TLS_REJECT_UNAUTHORIZED=0
before starting the application. If that works you know there is a certificate missing on your machine.
Most certainly this is not related to NestJS