SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Connect to a remote sql server using stunnel


Connect to a remote sql server using stunnel

Author
Message
papa_sarr
papa_sarr
SSC Journeyman
SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)

Group: General Forum Members
Points: 94 Visits: 441
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
DBA From The Cold
DBA From The Cold
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3457 Visits: 1757
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
papa_sarr
papa_sarr
SSC Journeyman
SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)

Group: General Forum Members
Points: 94 Visits: 441
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.
DBA From The Cold
DBA From The Cold
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3457 Visits: 1757
Are you using a SQL Server authenticated account to login?
papa_sarr
papa_sarr
SSC Journeyman
SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)

Group: General Forum Members
Points: 94 Visits: 441
Yes I am
DBA From The Cold
DBA From The Cold
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3457 Visits: 1757
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?
papa_sarr
papa_sarr
SSC Journeyman
SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)

Group: General Forum Members
Points: 94 Visits: 441
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
DBA From The Cold
DBA From The Cold
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3457 Visits: 1757
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.
papa_sarr
papa_sarr
SSC Journeyman
SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)SSC Journeyman (94 reputation)

Group: General Forum Members
Points: 94 Visits: 441
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.
DBA From The Cold
DBA From The Cold
Hall of Fame
Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)Hall of Fame (3.5K reputation)

Group: General Forum Members
Points: 3457 Visits: 1757
Same error when connecting in SSMS?
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search