SSL connection error from SQL server in Websphere - sql-server

WE are connecting to SQL server from our WAS(websphere). Connection is fine before we made the data present in SQL server encrypted and made the connection as SSL. From that onwards, we are getting SSL connection error. BUt we had installed the certificates under trusted key store in WAS console. Below is the error. Any help is appreciated. Thanks in advance.
Could not get JDBC Connection; nested exception is com.ibm.websphere.ce.cm.StaleConnectionException: [IBM][SQLServer JDBC Driver]The SQL Server login requires an SSL connection.DSRA0010E: SQL State = 08001, Error Code = 0
RAD version is 7.5.5
WAS version is Websphere Application Server 6.1

Issue resolved by installing SQL server drivers in WAS console. Not sure how it worked before encryption without drivers.
Thanks.

If you have SSL configured correctly, then I'm not sure what the following portion of the error mean:
The SQL Server login requires an SSL connection.DSRA0010E: SQL State = 08001, Error Code = 0
A StaleConnectionException is explained in the IBM link below:
http://www-01.ibm.com/support/docview.wss?uid=swg21063645
Perhaps if you paste the entire error stack we can see more clues. Is there a 'caused-by' clause for example? If this issue only occurred right after you have enabled SSL then you would also want to make sure both parties have common cipher suites.

Related

Failed to connect by IP address to an SQL Server, Error code 1312

I have to change my notebook to a new one. And I get this error :
TITLE: Connect to Server
Cannot connect to xxx.xxx.x.xx.
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1312)
A specified logon session does not exist. It may already have been terminated
The question is: why can't I connect to the database on my server (a physical server, not a notebook or PC) by IP address on this new notebook, while on the old I was able to do so?
I already tried to export and import the settings from my old notebook and following those steps written in this msdn forum too but nothing has changed.
All services is enabled, TCP/IP = Enabled, Both port has a default 1433 value, Named Pipes = yes
My old notebook has Windows 7 with default SQL Server installation, and my new notebook has the same too, but I decided to upgrade the OS to Windows 10 because I think it will fix the problem.
Now I have Windows 10 installed with No security software installed and Force disabling Firewall by Registry so it doesn't block the connection. But the problem is still there.
Could somebody help, please ?
I Found a solution but it's kinda ridiculous, I logged out my Microsoft Account and it works. But I still hope someone can explain why this can be happened. So if you guys have another solution, please put some here so I can learn it more about and to fix this error in another method.

Microstrategy 10.4 SQL ODBC Connection error

I've tried to connect an SQL database from a server with Microstrategy located in another server through an ODBC connector for SQL.
First I've checked that there is a connection between the two servers executing a ping sentence with the IP Address the other server and it went through.
After making sure the connection is stablished without issues, I've tried to connect through Microstrategy without success. The error I get is the following message:
"Connection test error: Connect failed. Error type Odbc error. Odbc operation attempted: SQLDriverConnect (08001:0: on SQLHANDLE)"
Using SQL Server 2017 for the databases and Microstrategy 10.4.
Please, anybody has any clue about what might be happening?
Thanks,
look at the type of connector to the db you have. It gave me the same error until I used: "with Native Client Driver".
Could you please share the complete error message, SQL Handle error are associated with multiple error scenarios like invalid username * password, connecting 64 bit server with 32 bit ODBC driver etc. Complete error message would help me to debug it.
In general follow the steps to debug the error, (any order)
Check the version of ODBC Connection (64bit / 32 bit), it should be the same as server version.
Try testing the ODBC connection that you have created using ODBC Administrator tools to see whether there is an problem with username & password/server name or database connection issue.
Check the Database Instance/Database Connection/User Login created under the Administration option to ensure everything is working and give the correct value.
if nothing works try using the native driver given by MicroStrategy, you can access this using Connectivity Wizard.
Hope it helps..

Cant connect to the Azure SQL Database

For the past month I have been using Microsoft SQL Server Management Studio tool to connect to my database which created on the Azure portal. Recently I received updates from Microsoft related to Microsoft Visual Studio. After I installed these, I can't connect to my SQL database (previously it was working fine). Update History Screenshot I attached the screenshot of recent updates (which I installed) and the error message for your view.Error Message
Please help to solve this issue.
note: I am an SQL beginner, so I don't know many technical things related to tools, so please keep your answers to my level, Thanks!
Update: Error Message
TITLE: Connect to Server
Cannot connect to abcxyz.database.windows.net.
ADDITIONAL INFORMATION:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)
The network path was not found
This error means that you tried to create a connection to an endpoint and you were expecting a acknowledgment from sql server, however, that acknowledgement did not occur. This means that you are either blocked by your own network, a network in route, or the endpoint network (which all three could be your own if, running locally). I would start by pinging that server ip address and seeing what you come up with.
that problem solved automatically, when I tried to keep connecting. really I don't know what was the problem..thanks for ur reply guys.

A connection was successfully established with the server, but then an error occurred during the pre-login handshake in SQL Server 2012

Today I could not log into my local SQL Server 2012 instance with the following error message
A connection was successfully established with the server, but then an error occurred during the pre-login handshake.
provider: SSL Provider, error: 0 - An internal error occurred.
(Microsoft SQL Server, Error: -2146893792)
I found many similar questions here and on the forums, but nothing helped. Please notice that in my case it just says
0 - An internal error occurred
There are no errors in Event Viewer;
I don't use Encrypted Connections;
In SQL Server Configuration Manager, Force Protocol Entryption is set to False, Trust Server Certificate is set to Yes (Originally it was No, but in both cases it didn't work);
I CAN connect to SQL Server using UDL;
I tried to re-install SQL Server with all related components;
Tried to uninstall .NET 4.5;
In SQL Management Studio, in connection properties, Encrypt Connection is unchecked.
It worked fine yesterday, I have not installed any software since then.
check that TCP/IP protocol is not enabled for clients. Without TCP/IP protocol you can not access the sql server from other clients. Following is the method to enable the protocol.
Go to the: Start-->Programs-->SQL Server--> Configuration Tools-->SQL Configuration Manager.
Expand the SQL Network Configuration and click on the PROTOCOLS node
Right click on TCP/IP and open up the PROPERTIES panel
Select the IP ADDRESS tab
http://sqlanddotnetdevelopment.blogspot.in/2013/07/a-connection-was-successfully.html
In our case it was the problem with the SSL/TLS. We just disabled tls 1.0 to make sure we were compliant with PCI DSS but it stopped SQL Server. Then we had to install one update from Microsoft and then did the disable thing using IISCrypto instead of using the registry. Here's the steps we followed:
https://www.itechtics.com/connection-successfully-established-error-occured-pre-login-handshake/
I got this error connecting to localhost with the newest version of Microsoft.Data.SqlClient.
Turns out that Microsoft really wants you to encrypt your database, for security.
This can be fixed client side by changing the connection string, by adding an Encrypt=False parameter, eg:
SERVER=.\SQLEXPRESS;DATABASE=MyDatabase;Integrated Security=True;Encrypt=False;
See Rick strah's blog post on the subject
In our case same error occurred due to spn not set.Try checking if spn is set. As others suggested in comments you can see ring buffer entries which holds more info .if you are able to repro more often try running netmon or wireshark in parallel
None of this stuff worked for me.. in the end I had to install the cumulative update for SQL Server 2014 SP1
SQL Server Cumulative Updates
In my case the error was fixed by adding "Encrypt=False" like this:
Server=localhost\\SQLEXPRESS;Database=*YOUR_DATABASE*;Trusted_Connection=True;Encrypt=False
Disable TLS 1.2 protocol and enabled 1.0 /1.1 . Re-installed SQL server post restarting the server

IIS 7 can't connect to SQLServer 2008

Sorry if this is the most seen question on the web, but this is my turn. I am trying to publish my asp.net mvc app on IIS 7 under MS Sql Server 2008. I am on a Windows Server 2008 virtual machine. I get the following classical error:
A network-related or instance-specific
error occurred while establishing a
connection to SQL Server. The server
was not found or was not accessible.
Verify that the instance name is
correct and that SQL Server is
configured to allow remote
connections. (provider: SQL Network
Interfaces, error: 26 - Error Locating
Server/Instance Specified)
Under SQLServer, Allow remote connections is checked. My connection string is:
Data Source=.\MSSQLSERVER;Initial Catalog=mydbname;User Id=sa;Password=mypassword
I also tried with no username/password and "Integrated Security=true". There is only one instance of SQLServer installed.
I tried to access my web page locally and remotely. There is no active firewall on the virtual machine.
Make sure you have TCP/IP set up as a transport in your SQL Server configuration tool.
Thanks guys for the try. I found the solution and it is related to an info that I forgot to give. I hope it can help someone as new as me on these things.
I use NHibernate, and the connection string is actually in the nhibernate.cfg.xml file. The one in the web.config file is actually used by my various providers (users/roles). I fixed that by removing the connection string from the NH config file. I now retrieve it with:
string connectionString = ConfigurationManager.
ConnectionStrings["myConnectString"].ConnectionString;
and I set it in NH with:
Configuration cfg = new Configuration();
cfg.Configure(cfgFile);
cfg.SetProperty(NHibernate.Cfg.Environment.ConnectionString, connectionString);
Now I get:
Cannot open database "mydb"
requested by the login. The login
failed. Login failed for user 'NT
AUTHORITY\NETWORK SERVICE'.
But this is another story, for another question if I can't find the answer.
PS: I had to use "." as the server name otherwise .\MSSQLSERVER was producing a new error "invalid connection string". Thx Ian and Jared for the tip.
is that the actual data source line from the web config?
If so then it's should be in quotes of course, for safety add a ; on the end and check that is the actual name of your instance, you can check windows services for your instance name.
try substituting localhost instead of . and can you connect from sql server management studio using the credentials in your connection string?
As mentioned by Robert, try:
ConnectionString="Data Source=(LOCAL)\MSSQLSERVER;Initial Catalog=mydbname;User ID=sa;Password=mypassword"
I'm not sure if connection strings are case sensitve, but I notice that you have 'Id' instead of 'ID'.
Edit:
Am not sure if you need \MSSQLSERVER?
are you sure it's a named instance of SQL?
try
Data Source=.;Initial Catalog=mydbname;User Id=sa;Password=mypassword
UPDATE:
from this site
did you try the following:
Make sure the server machine is reachable, e.g, DNS can be resolve correctly, you are able to ping the server (not always true).
Make sure SQL Browser service is running on the server.
If firewall is enabled on the server, you need to put sqlbrowser.exe and/or UDP port 1434 into exception.
Well I am facing the same above issue since morning (past 8 hours) did lots of stuff like create a Domain Name, setup a new application pool identity but nothing worked :(
I just made a small changes in web.config file for connection string that is:
Integrated Security=False instead of True... and now it is working perfectly

Resources