Score:0

SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746

cn flag

I'm using PHP Laravel 7.4 on Ubuntu 20.04 and trying to get data from SQL Server located on a Windows server in another cloud.

This method was tested on my PC (Windows) and it successfully retrieved the data from the Windows server. However, on my Ubuntu server, I follow the documentation from Microsoft and get this error:

SQLSTATE[08001]: [Microsoft][ODBC Driver 17 for SQL Server]
TCP Provider: Error code 0x2746 (SQL: myquery) 
{"userId":94,"exception":"[object] 
(Illuminate\Database\QueryException(code: 08001): SQLSTATE[08001]: 
[Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 
0x2746 (SQL: myquery) at /var/www/web-api/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669)

I checked the logs in Microsoft SQL Server Management Studio and I notice this message appears every time I make a request from Ubuntu

"An TLS 1.2 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. The SSL connection request has failed."

How can I fix this?

Score:0
in flag

An 08001 error occurs when an ODBC connection to a SQL Server database fails. You've mentioned two things that stand out:

  1. this works on your local development machine
  2. the SQL Server instance is running (perhaps) at another cloud provider

As the connection works from your local machine, the Username/Password is likely correct, but you will want to check. The most likely culprit, however, is going to be the firewall. Confirm that the Ubuntu Server's IP address is permitted through the firewall for the Windows Server running SQL Server.

The following ports will need to be available:

TCP: 1433, 4022, 135, 1434
UDP: 1434

naif basalib avatar
cn flag
I did as you mentioned above and I'm still facing the same error. However, I checked the logs in MSSQL and I notice this message appear every time I make a request from Ubuntu "An TLS 1.2 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. The SSL connection request has failed."
in flag
That error makes this a Windows Server-related issue. Check out [this documentation](https://docs.microsoft.com/en-us/windows-server/security/tls/tls-registry-settings#tls-dtls-and-ssl-protocol-version-settings) from Microsoft about how to configure the TLS and SSL protocol settings.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.