How to encrypt connection to SQL Server in Node.js - sql-server

I am using the mssql client for node.js to connect to SQL Server 2014. This is working great, however there is now a new requirement to use the highest level encryption (TLS 1.2) for communications to all databases. The only documentation I am able to find on encrypted connection to SQL Server in Node.js is the encrypt:true property of the connection options which is designated for Azure connections. This is an on-premise database, when i do set encrypt:true the connection just stalls. No error, just does not successfully connect. Any help with direction on this is greatly appreciated.

After doing some testing with MSSQL driver, I was able to successfully connect to SQL Server 2014 over TLS 1.2 by having our DBA's force encryption at the database and require TLS 1.2, then adding the encrypt:true property to the connection options. Our production app has an ORM layer through Sequelize so using the native MSSQL under the hood, I added
dialectOptions {
encrypt: true
}
to the Sequelize connection object and tada

Related

Entity Framework tries to use SQL Server secure enclaves when is not configured

I have a database with always encrypted in SQL Server Express.
I migrated my SQL Server version from 2017 (v14) to 2019 (v15), in this new version there is a secure enclave option available for always encrypted that I'm not using.
When I connect from SQL Server Management Studio, everything is fine, I can see the encrypted information as always, but when I try to use it on my application with Entity Framework, I get this error:
System.Data.SqlClient.SqlException: Operation supported by enclaves invoked on data encrypted with randomized encryption where the keys are not enclave-enabled. Please clear the proc cache
My connection string is:
Data Source=localhost\SQLEXPRESS;Initial Catalog=Derma2Go_test;Integrated Security=True;MultipleActiveResultSets=True;Column Encryption Setting=enabled
I get error #33580 in SQL Server.
I am using Entity Framework 6.0.0.0
I don't want to use the secure enclaves in my database, how can I resolve this issue?

How do I resolve encryption error connecting to SQL Server from Oracle SQL Developer

My objective is to use the migration tool in SQL Developer to migrate 2 SQL Server databases to Oracle. I am attempting to connect to a SQL Server database at a remote location using Oracle SQL Developer 4.0.
I have installed jtds.1.3.0.jar per instructions, and get the SQL Server and Sybase tabs in the connection properties window.
I have entered the user, pw, hostname, port, and database name. When I try to Retrieve Database, or connect, I get the error message:
Status : Failure -Test failed: I/O Error: DB server closed connection.
The SQL Server DBA tells me her error logs contain the following error message:
Encryption is required to connect to this server but the client library does not support encryption; the connection has been closed. Please upgrade your client library. [CLIENT: (my computer's IP address)] Error: 17835, Severity: 20, State: 1.
When I look at SQL Server documentation about this error message, it talks about certificates and SQL Server Connection Manager. Some relevant information to show that I've covered the basics:
Using the same connection parameters, I am able to connect to the SQL Server database using Toad for SQL Server.
Using the same connection parameters, a DBA set up an Oracle Transparent Gateway, and I can connect to the SQL Server database using the gateway and a database link. (As far as I know, neither of these methods required a certificate to connect.)
Both of these use ODBC; SQL Developer uses jdbc with TCP/IP.
The DBA assures me TCP/IP connection is turned on for the SQL Server databases.
I have gone into the XML file where SQL Developer stores the connection string. It has the form jdbc:jtds:sqlserver://sql-xxx-xxx.mw.nos.xxx.com:1433/my_db, which looks correct. I have tweaked it by adding the instance name, but no difference. The database has a default instance name, anyway, so it shouldn't be necessary.
A co-worker has been able to connect to a local SQL Server database on the same machine where SQL Developer was running (both on his laptop).
As a workaround, I am also pursuing the possibility of installing SQL Server on a local workstation, and copying the databases there for processing, but I don't know if I can get approval. If you know another tool for migrating from SQL Server to Oracle, please also let me know.
Thanks in advance.

Connect SymmetricDS to ParaSQL

We're trying to test loading data from our on-premise SQL Server 2008R2 machine to ParaSQL using SymmetricDS. We have a dedicated server instance with ParaSQL which requires an SSL connection. Certificates are provided by ParaSQL.
Where we're stuck is how to configure SymmetricDS to use secure socket layer for this connection. We can find some info in the documentation on how to generate keys on our end, but nothing on how to connect using provided certificates.
Does anyone here have any experience with that?
Thanks in advance.
With SymmetricDS there is an SSL connection between the SymmetricDS nodes, and a different one between the JDBC driver and the database itself. The keys you are generating sound like they are for the node-to-node SSL. I believe what you need to do is setup the ParaSQL supplied SSL certificates for the JDBC driver that is making the connection to the database.

SQL Server Exception

My requirement is simple: I have an appserver - WAS 6.1 connecting to Microsoft SQL Server 2008 R2.
I have configured data source for the SQL server using the installation scripts in linux.
When I deployed EAR and try to hit application url, I get the below error while connecting to SQL Server.
com.ibm.websphere.ce.cm.StaleConnectionException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: SQL Server did not return a response. The connection has been closed..CWWRA0010E: SQL State = 08S01, Error Code = 0
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:67)
The setup is working for another server configuration.
After a long wait, the issue got resolved. There is nothing to do with the EAR. The SSL encryption was enabled in SQL server settings. Just disable the settings did let me establish connection from application to the SQL server.

Visio - Reverse Engineering a Database Model from an Azure SQL Server DB -- Crashing

In the Microsoft SQL Server Setup for database drivers, I have checked off SQL Server, SQL Server Native Client 10.0, and SQL Server Native Client 11.0.
I have created 6 data sources, one for each "type of data source" (user data source or system data source, as file data source doesn't show up) multiplied by each driver (SQL Server, Native Client 10.0, and Native Client 11.0).
When creating the data sources, I request SQL Server authentication and give the username and password.
Before saving, I test the connection and it succeeds.
When I try to connect to the database, it requests my username/password. When I give my credentials, Visio crashes. If I misspell my credentials, Visio tells me that my credentials were invalid.
Any suggestions?
The following worked for me: I used the ODBC generic driver with the Native Client 11.0.
One could also try the suggestion in the comment above by #mellamokb.

Resources