[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Persistent Connection for Stunnel

Posted on 2007-11-21
6
Medium Priority
?
3,070 Views
Last Modified: 2012-06-27
with Stunnel as the HTTPS SSL proxy I am connecting to a SSL server, with stunnel listening in my localhost on 4800. However, for every connection i make to localhost:4800 it seems to make a new connection to the remote SSL server too.

What I need is that when I run stunnel, it will connect to the remote server and maintain the connection. This same connection will be used for all the rest of the data I send to localhost:4800 and not create a new one.

Is there a setting I can add to make it persistant?

0
Comment
Question by:archerlogic
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
alextoft earned 2000 total points
ID: 20330710
stunnel appears to be working as intended.

Perhaps what might be more suitable for your requirements is an IPsec VPN?
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 20331248
ssh -P -f -l 4800:<remote ip>:<remote port> <username>@<ssh host> sleep 10000

so that:

ssh -P -f -l 4800:192.168.1.15:80 me@192.168.1.85 sleep 10000
0
 
LVL 27

Expert Comment

by:Nopius
ID: 20332524
Stunnel _can_ keep connection active when 'session' and 'TIMEOUTidle' are specified. man stunnel. But some remote WEB servers close connection after each https:// request.

I just tested this very simple stunnel configuration:

[https]
accept  = 8080
client  = yes
connect = dave.sni.velox.ch:443
session = 300
TIMEOUTclose = 0
TIMEOUTidle = 180

When trying to connect to localhost:8080 and  get any page:
Connected to localhost.
Escape character is '^]'.
GET / HTTP/1.1
Host: dave.sni.velox.ch
Connection: keep-alive

I always get "Connection: close" with subsequent TCP connection close:

HTTP/1.1 200 OK
Date: Thu, 22 Nov 2007 04:05:10 GMT
Server: Apache/2.2
Cache-Control: max-age=0
Expires: Thu, 22 Nov 2007 04:05:10 GMT
Connection: close
Transfer-Encoding: chunked
Content-Type: text/html; charset=ISO-8859-1

...

So I guess the problem is not in stunnel, but in remote server, that closes connection and you can do nothing with that.

0
 
LVL 27

Expert Comment

by:Nopius
ID: 20332552
Oops, after some more testing with tcpdump I agree with alextoft, new connection to stunnel = new outgong TCP request. When incoming connection closes, outgoing connection also closes. That's logical, otherwise we could use other session, say after someone had authenticated, dropped connection and we connected to the same session and resume connection as that first authenticated user.

0

Featured Post

Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
​Being a Managed Services Provider (MSP) has presented you  with challenges in the past— and by meeting those challenges you’ve reaped the rewards of success.  In 2014, challenges and rewards remain; but as the Internet and business environment evol…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question