Advertisements

Archive

Posts Tagged ‘Database connection’

The client and server cannot communicate, because they do not possess a common algorithm


I recently faced an interesting issue when trying to fetch data from third-party API. When trying to connect to the API endpoint, I received the following error message:

“An error occurred while making the HTTP request to https://<API endpoint>. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.” Inner exception was “Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.”

Solution :

The issue came up when we setup a Thycotic Secret Server on a hardened OS. On the OS TLS 1.0 was disabled for security reasons, however at the moment the used Microsoft SQL server didn´t speak TLS 1.1 or TLS 1.2. So the error message:

A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 – The client and server cannot communicate, because they do not possess a common algorithm.)

After TLS 1.0 was enabled on the Thycotic Server the installation could be performed without issues. So make sure that your Microsoft SQL environment is up to date and supports TLS 1.1/1.2 if you wish to disable TLS 1.0.

Advertisements

Visual Studio – Database Project Not Loading


Have you ever created a Database project and after some time you are not able to load it in the Visual Studio? Probably you might be getting following error:

An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)

The database project requires an active database connection to load at design time. Probably it uses that to compile/verify scripts. The problem here is Visual Studio is not able to connect to any such instance. Following are few solutions (these worked for me)

  1. Make sure the instance to which you want to connect is running and allows remote connections.
  2. After performing step 1, if it is still not loading then you may need to start the SQL Browser Service. Make sure it’s running.
  3. If the problem is still there, it has to be fixed from Visual Studio itself. Actually database project do not store to which instance it can connect. It’s a Visual Studio setting.In VS2008 go to Tool > Options > Database Tools > Design-time Validation Database > Connection Options. Specify your instance name here like “\SQLEXPRESS”

Also If you upgraded your database project from 2005 to 2008 and if  you try to open the 2008 database project solution file then you may get the following error:

Coluld not load file or assembly ‘System.Data.SqlServerCe, Version=3.5.1.0, Culture=neutral, PublicKeyToken = 89845dcd8080cc91’ or one of its dependencies. The system cannot find the file specified.

To resolve this you need to install SQL Server CE 3.5 SP1 from here: http://www.microsoft.com/downloads/details.aspx?FamilyID=dc614aee-7e1c-4881-9c32-3a6ce53384d9&displaylang=en

Hope it helps !