MSSQL Direct DB Connection on AWS EC2 instance - Connection Error related to SSL routines

Hi,

I am working on a website project that will be connected to a MSSQL database to dynamically generate lists/tables/PDF etc. The server model for the project is ASP.NET.

I have created a connection under ‘Server Connect Connection’ and it is working OK. However, when I try to create a ‘Direct Database Connection’ with the same server credentials, I get an error as below:

Error connecting: Failed to connect to x.x.x.x 4565007808:error:1425102:SSL routines:ssl_choose_client_version:unsupported protocol:../../third_party/node-nw/deps/openssl/openssl/ssl/statem/statem_lib.c:1929

The MSSQL database is running on an AWS EC2 instance, which is managed by a third party IT company.

I am not sure whether there is any setting in the DB Manager that I need to configure to work with AWS. As far as I know, there’s no SSL on the server, as I have other web applications that connect to the same database without any error.

Any help in troubleshooting and resolving the issue is greatly appreciated. Thanks.

Screen Shot 2020-08-20 at 6.38.18 pm

What did you enter as connection options?

Hi George,

I have selected Microsoft SQL Server as the database type. I haven’t selected any SSL and SSH options. I tried selecting Amazon RDS under SSL, but this option also didn’t work.

Try enabling the SSL and use the default profile.

Hi George,

I’m getting the same error with SSL and Default Profile options.

Hi @George

Are there any other connection config settings I can try to resolve this issue?

Locate the database connection config file and open it:

.wappler/targets/your_target/databases/conn_name.json

where “your_target” is your currently selected and the “conn_name” is your db connection name.
If you are opening it from Wappler file manager make sure to enable show hidden files first from the context menu so you can see the .wappler folder

In this json file you will see something like:

{
  "direct": true,
  "type": "mssql",
  "connection": {
    "host": "xxxxx",
    "port": xxx,
    "user": "xxxx",
    "password": "xxxx",
    "database": "xxxxx"
  },

Add extra value “encrypt” : false, like:

{
  "direct": true,
  "type": "mssql",
  "connection": {
    "host": "xxxxx",
    "port": xxx,
    "user": "xxxx",
    "password": "xxxx",
    "database": "xxxxx",
    "encrypt" : false
  },

Let me know if this works.

Seems some MSSQL configurations does not have the right SSL options.
I based this on this issue: https://github.com/tediousjs/tedious/issues/914

Hi George,

The database is loading all the tables now after adding this value in the connection ‘json’ file.

However, the Direct DB Connection is still showing the same error when Testing the connection. Is it going to create any issue further in to the development cycle?

Thanks for helping me with this issue; much appreciated :grinning:

No - it is all fine now.

I will add this option to the UI so the test also works

Thanks @George :+1:t5:

1 Like