Solved

Persistent Connection for Stunnel

Posted on 2007-11-21
6
2,738 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
  • 2
6 Comments
 
LVL 19

Accepted Solution

by:
alextoft earned 500 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 28

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
"uptime" high (200+) on RHEL6 but CPU usage is low... any ideas why? 4 106
exchange , certificates 9 40
exchange , certificates 7 42
Review of a VPN cert policy 4 28
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 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