1

I am trying to use Stunnel to connect to a remote server through a proxy (I am using stunnel 4.56).

Here is my config file stunnel.conf:

cert = stunnel.pem
key = stunnel.pem

[https]
accept = 127.0.0.1:556
protocolHost= 128.45.65.36:80
connect = 556.79.65.20:80
verify = 0

Each time I double-click on stunnel.exe, all I get in the logs is :

2013.04.25 17:17:00 LOG5[3272:8956]: Reading configuration from file stunnel.conf
2013.04.25 17:17:00 LOG5[3272:8956]: FIPS mode is enabled
2013.04.25 17:17:00 LOG5[3272:8956]: Configuration successful

Someone knows what is the problem? I expect at least an error saying that he cannot connect but nothing here ...

  • Stunnel is not a VPN, it is basically a proxy. It does not open a persistent connection when the daemon is launched. It will not make a connection to the remote host until you connect to the listening port. – Zoredache Apr 25 '13 at 17:29
3

I finally managed to make it work. I now have the following stunnel.conf file:

; Certificate
cert = stunnel.pem
;FIPS
fips=no
; Protocol version (all, SSLv2, SSLv3, TLSv1)
sslVersion = all

; Some performance tunings  
socket = l:TCP_NODELAY=1  
socket = r:TCP_NODELAY=1  

; Some debugging stuff useful for troubleshooting  
debug = 7  
output = stunnel.log  

; Use it for client mode  
client = yes

; Service-level configuration
[FIX]  
accept = 127.0.0.1:port
connect = proxy:80
protocol=connect
protocolHost= target-server:443
TIMEOUTconnect  = 5

Basically I want to connect to a FIX server through a proxy. The connection is now made but it seems their server is not accepting my connection. I see this in the stunnel logs :

2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): before/connect initialization
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv2/v3 write client hello A
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 read server hello A
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 read server certificate A
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 read server done A
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 write client key exchange A
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 write change cipher spec A
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 write finished A
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 flush data
2013.04.26 14:05:06 LOG7[12312:13560]: SSL state (connect): SSLv3 read finished A
2013.04.26 14:05:06 LOG7[12312:13560]:    1 items in the session cache
2013.04.26 14:05:06 LOG7[12312:13560]:    1 client connects (SSL_connect())

2013.04.26 14:05:06 LOG7[12312:13560]:    1 client connects that finished

2013.04.26 14:05:06 LOG7[12312:13560]:    0 client renegotiations requested

2013.04.26 14:05:06 LOG7[12312:13560]:    0 server connects (SSL_accept())

2013.04.26 14:05:06 LOG7[12312:13560]:    0 server connects that finished
2013.04.26 14:05:06 LOG7[12312:13560]:    0 server renegotiations requested
2013.04.26 14:05:06 LOG7[12312:13560]:    0 session cache hits
2013.04.26 14:05:06 LOG7[12312:13560]:    0 external session cache hits
2013.04.26 14:05:06 LOG7[12312:13560]:    0 session cache misses
2013.04.26 14:05:06 LOG7[12312:13560]:    0 session cache timeouts

I think I might need to input a login and password. Someone knows how to do this with stunnel? I tried protocolCredentials but it does not work.

  • This line means that the target server is not accepting my connection ? "2013.04.26 14:05:06 LOG7[12312:13560]: 0 server connects (SSL_accept())" – user171186 Apr 26 '13 at 16:42
  • This line means that the target server is not accepting my connection ? – user171186 Apr 26 '13 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.