Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1227
  • Last Modified:

SQL Connection through Microsoft ISA Proxy Server

Hi Experts

I have developed an applicaton that connects to a remote database. This application works fine on most machines but in one office they connect to the internet through a proxy server. Because of this, the database cannot be accessed and the following exception occurs:  

System.Data.SqlClient.SqlException: 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:
TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
   at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObjec
t stateObj)
   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, SqlConnection owningObject)
   at
System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo
serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String
host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
   at
System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection
owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
   at
System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentit
y identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean
redirectedUserInstance)
   at
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOpti
ons options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
   at
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnec
tion owningConnection, DbConnectionPool pool, DbConnectionOptions options)
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject)
   at
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject)
   at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection
owningObject)
   at
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection
owningConnection)
   at
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection
outerConnection, DbConnectionFactory connectionFactory)
   at System.Data.SqlClient.SqlConnection.Open()

How can I configure the connection to the remote database so it works through the ISA proxy server? Or can this be configured through the actual ISA proxy server.

Thanks in advance

Tom
0
TommyTwoPints
Asked:
TommyTwoPints
  • 3
  • 2
1 Solution
 
Keith AlabasterEnterprise ArchitectCommented:
<<System.Data.SqlClient.SqlException: 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:
TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException>>

Would need to know the rules applied to ISA. If ISA is installed as a proxy only or as a firewall/proxy? Are they using the ISA firewall client? The tcp error stating that the sql db actively refused the connection - do you see reject log messages for these connections on the db server - or is the traffic not really getting that far?
0
 
TommyTwoPintsAuthor Commented:
Hi Keith,

Thank you for your quick reply,

As this is a clients office I do not actually know how their ISA is configured nor do I have access to their server.

Where is the error log file on the remote server which contains the database? This is our remote server so i have access to this.

Cheers

Tom
0
 
Keith AlabasterEnterprise ArchitectCommented:
No idea Tom. ISA is my area of speciality rather than sql.
Reading your question, it suggested that the app was installed on the remote work stations and that that they connected to a database server that was held elsewhere - are you saying the database server is remote 9to you) but on the same site as the work stations?
0
 
TommyTwoPintsAuthor Commented:
The application is installed on the clients machine in their office which are all connected to their ISA proxy server VIA a local network.

The database server is remote to everyone as it is a rented server based in the United States.

No error dump is being created so the connection is being blocked by the proxy server. I expect the client application is confused and thinks it is the database rejecting it and not the proxy server.

If I was to connect to the database through the port for the proxy server, could this work?

Cheers

Tom
0
 
TommyTwoPintsAuthor Commented:
I did fix this problem by allow port number selection thus editing the connection string based on the users specification.

Sorry for not requesting this to be closed earlier,

Thanks

Tom
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now