Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 123»»»

Connect to a remote sql server using stunnel Expand / Collapse
Author
Message
Posted Friday, January 25, 2013 12:01 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 11:45 AM
Points: 12, Visits: 277
Hello everyone,

I am trying to connect to a remote sql server using stunnel. I have already configure the stunnel.conf file on both side.
When I am connect to the remote SQL Server, I am getting the following error:
"A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)"
My remote server is configured to accept unlimited connections.

Any suggestions or ideas?

Thank you
Post #1411882
Posted Tuesday, January 29, 2013 6:33 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 10:38 AM
Points: 1,304, Visits: 1,133
I'm not too familiar with stunnel but you could check your logins on the instance. Does the specified login have the required permissions?

Andrew
Post #1413002
Posted Tuesday, January 29, 2013 11:13 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 11:45 AM
Points: 12, Visits: 277
Thank you for your reply

The login has the proper permission.
I forgot to mention that I was able to connect to the remote SQL server from within our network.
From outside the network, I am getting the error. I can telnet to the SQL server.
Also the network administrator is telling me that there is no firewall blocking incoming traffic to the specified port.
Post #1413206
Posted Tuesday, January 29, 2013 11:32 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 10:38 AM
Points: 1,304, Visits: 1,133
Are you using a SQL Server authenticated account to login?
Post #1413212
Posted Tuesday, January 29, 2013 12:06 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 11:45 AM
Points: 12, Visits: 277
Yes I am
Post #1413230
Posted Tuesday, January 29, 2013 12:13 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 10:38 AM
Points: 1,304, Visits: 1,133
OK, as you can connect to the instance within the network the problem is not there.

Have you tried specifying the port in the connection to the instance?
Post #1413237
Posted Tuesday, January 29, 2013 12:26 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 11:45 AM
Points: 12, Visits: 277
Yes I have tried,

Basically, Stunnel allows you to encrypt the TCP connection between the client and the SQL server using SSL. On both side, you install stunnel and configure it.

Client side

Accept connection on 127.0.0.1:1433
Connect to x.x.x.x:443 (x.x.x.x being the external ip address of the SQL server, and 443 being the only open port to the SQL Server)

Server Side
Accept all incoming connection on 443
connect to 127.0.0.1:1433

From the client side, you open SSMS and connect to 127.0.0.1, and stunnel redirect the traffic to 127.0.0.1:1433 on the SQL Server
Post #1413248
Posted Tuesday, January 29, 2013 12:31 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 10:38 AM
Points: 1,304, Visits: 1,133
If you can connect to the instance from the client side with SSMS then the problem must be with stunnel.

Sorry I'm not familiar with stunnel.
Post #1413252
Posted Tuesday, January 29, 2013 12:40 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, October 14, 2014 11:45 AM
Points: 12, Visits: 277
When both machines belong to the same network (replacing the x.x.x.x with the internal IP address of the SQL server), I have no problem connecting to the SQL server through Stunnel. However, when the client is outside our network, I am getting the error.

Anyway, thank you for your help.
Post #1413260
Posted Tuesday, January 29, 2013 12:43 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Today @ 10:38 AM
Points: 1,304, Visits: 1,133
Same error when connecting in SSMS?
Post #1413263
« Prev Topic | Next Topic »

Add to briefcase 123»»»

Permissions Expand / Collapse