0

I am using Stunnel to connect to a server with TLS encryption. I start Stunnel, then I use any client to connect to Stunnel (e.g. telnet) and everything works fine. If I close the client the connection with the server remains active, the connection with the client goes to state TIME_WAIT.

But here is the problem, if I try to open the client again, the connection to Stunnel is lost instantaneously.

What can be the problem?

rodripf
  • 575
  • 2
  • 11
  • 24
  • sounds maybe like a SO_REUSEADDR issue, have you set `socket = a:SO_REUSEADDR=no` in your config? If yes, try without – Stefan Hegny May 23 '16 at 17:38
  • Nope, I am not using that option. Anyway I tried setting it to yes without changes. Thanks anyway. – rodripf May 24 '16 at 19:55

1 Answers1

0

It was a problem with the server not accepting TSL handsake renegotiation, a feature that comes by default with Stunnel and cannot be changed via configuration. So I had to modify the source code of stunnel to force it to make the handshake each time the connection is established.

rodripf
  • 575
  • 2
  • 11
  • 24