SAM2009
asked on
How to connect to SQL server without using ODBC?
Hi,
I have an application running in Linux server which use ODBC to connect on Windows 2008 SQL server but I got an SSL error.
To eliminate any possibilty that error is from ODBC is it possible to test the connection without ODBC? Sorry I'm not too familiar with SQL that's why I need your help.
Thanks
I have an application running in Linux server which use ODBC to connect on Windows 2008 SQL server but I got an SSL error.
To eliminate any possibilty that error is from ODBC is it possible to test the connection without ODBC? Sorry I'm not too familiar with SQL that's why I need your help.
Thanks
I don't know why you would get an SSL error. What programming language are you using?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Honestly which program language it's used I don't know. The only thing that interest me for now is how to test the connection without ODBC?
Thanks Dhara but beside that cmd is there any tool that I can use to test myself on Windows?
Thanks Dhara but beside that cmd is there any tool that I can use to test myself on Windows?
It's ASP.NET
ASKER
When it uses SSL to connect on SQL server does it mean that SSL certificate should be installed on SQL server?
In C++ You can connect using ODBC without a DSN using SQLDriverConnect. Specify the name of an installed driver in the connection string. A SQL Server Native client 11 example:
Driver={SQL Server Native Client 11.0};Server=SqlHostName;D atabase=So meSqlDatab ase;UID=Yo urUserName ;PWD=YourP assword
Code snippet:
retcode = SQLDriverConnect(hdbc
, NULL
, (SQLCHAR*)InConnectionStri ng
, (SQLSMALLINT)sizeof(InConn ectionStri ng)
, (SQLCHAR*)OutConnectionStr ing
, (SQLSMALLINT)sizeof(OutCon nectionStr ing)
, (SQLSMALLINT*)StringLength 2Ptr
, (SQLUSMALLINT)DriverComple tion
);
Driver={SQL Server Native Client 11.0};Server=SqlHostName;D
Code snippet:
retcode = SQLDriverConnect(hdbc
, NULL
, (SQLCHAR*)InConnectionStri
, (SQLSMALLINT)sizeof(InConn
, (SQLCHAR*)OutConnectionStr
, (SQLSMALLINT)sizeof(OutCon
, (SQLSMALLINT*)StringLength
, (SQLUSMALLINT)DriverComple
);
If encryption of the connection required, you can set the OpenSSL.conf not to validate the certificate which is likely what the issue is the certificate presented in the one ton can not be validated no thus the connection drops.
To test you have to have info on what you are using. Likely freetds.
The example provided is for a Windows system.
Adding the SQL server cert is trusted would eliminate the error......
Double check whether your setup is actually using web based XML queries to the DB.
To test you have to have info on what you are using. Likely freetds.
The example provided is for a Windows system.
Adding the SQL server cert is trusted would eliminate the error......
Double check whether your setup is actually using web based XML queries to the DB.
ASKER
Correct me if I'm wrong but to be able to use an SSL connection on SQL server a certificate is required right on SQL server? Because I don't see any certificate.
Look within the data for, there should certs there. Check the TCP/ip in the SQL server configuration dealing with encryption...
Did it work before and only stopped recently or is it the first setup...
Did it work before and only stopped recently or is it the first setup...
ASKER
When you said look withing the data, what you meant?
Your existing application, how is it interacting/connecting to the DB.
On linux, what programing language is being used is this a PHP page, python, tcl, etc.
When do you see an SSL error and from what application/interface?
On linux, what programing language is being used is this a PHP page, python, tcl, etc.
When do you see an SSL error and from what application/interface?
ASKER
It's a third party application.
But what I really need is that someone could confirm if ssl connection on sql server needs a cert installed on that server.
Could you just confirm that please?
But what I really need is that someone could confirm if ssl connection on sql server needs a cert installed on that server.
Could you just confirm that please?
There is no way to confirm that other than looking on the SQL server to see whether it requires an encrypted connection.
Where and when do you see the SSL connection error?
The third party application might as part of its process have to validate the licensing meaning it has to connect to the vendor's secure site and that is where you are getting the SSL connection error, i.e. the URL for license validation has issues.
Where and when do you see the SSL connection error?
The third party application might as part of its process have to validate the licensing meaning it has to connect to the vendor's secure site and that is where you are getting the SSL connection error, i.e. the URL for license validation has issues.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
SSL connection port to Windows SQL server is it tcp/1433 or this port is used also for non ssl connection?
I think it will remain 1433 the client and server negotiate if to encrypt or not. Or server can require encryption.
ASKER
Thanks for your hep!