title: Stunnel "Peer suddenly disconnected" error with QuickFix/n
body: <p>Recently I started to use Stunnel program with QuickFix/n Engine to connect my VPS server and broker's server.</p>
  
  <p>I am getting "Peer suddenly disconnected" error from Stunnel. I am very new to Stunnel and would like to know what are the possible problem for this  "Peer suddenly disconnected" error. Below is the log message from log file of stunnel while I am running QuickFix application.</p>
  
  <pre><code>2014.11.27 01:10:46 LOG7[944]: Service [FIXORDER] started
  2014.11.27 01:10:46 LOG5[944]: Service [FIXORDER] accepted connection from x.xxx.xxx.xxx:3667
  2014.11.27 01:10:46 LOG6[944]: s_connect: connecting xx.x.xx.xx:9002
  2014.11.27 01:10:46 LOG7[944]: s_connect: s_poll_wait xx.x.xx.102:9002: waiting 10 seconds
  2014.11.27 01:10:46 LOG5[944]: s_connect: connected xx.x.xx.xx:9002
  2014.11.27 01:10:46 LOG5[944]: Service [FIXORDER] connected remote server from x.xxx.xxx.xxx:3668
  2014.11.27 01:10:46 LOG7[944]: Remote socket (FD=392) initialized
  2014.11.27 01:10:46 LOG6[944]: SNI: sending servername: xxx.x.xx.xx
  2014.11.27 01:10:46 LOG7[944]: SSL state (connect): before/connect initialization
  2014.11.27 01:10:46 LOG7[944]: SSL state (connect): SSLv2/v3 write client hello A
  2014.11.27 01:10:46 LOG3[944]: SSL_connect: Peer suddenly disconnected
  2014.11.27 01:10:46 LOG5[944]: Connection reset: 0 byte(s) sent to SSL, 0 byte(s) sent to socket
  2014.11.27 01:10:46 LOG7[944]: Remote socket (FD=392) closed
  2014.11.27 01:10:46 LOG7[944]: Local socket (FD=380) closed
  2014.11.27 01:10:46 LOG7[944]: Service [FIXORDER] finished (0 left)
  </code></pre>
  
  <p>Here is some code lines I wrote on stunnel.conf file to establish the connection between my VPS and Broker's server. I put my VPS IP address to "accept" and I put broker's IP address to "connect". As brokers gave me two different ports to connect, I wrote lines for two different connection.</p>
  
  <pre><code>[FIXPrice]
  client = yes
  accept = x.xxx.xxx.xxx:3001
  connect = xxx.x.xx.xxx:9001
  
  
  [FIXORDER]
  client = yes
  accept = x.xxx.xxx.xxx:3002
  connect = xxx.x.xx.xxx:9002
  </code></pre>
  
  <p>After set up stunnel.conf file, I run the stunnel service. Then I started my Quick Fix application to establish connection. However my Quick Fix Application can not pass the log on stage and Stunnel keep getting "Peer suddenly disconnected" error repeatedly.</p>
  
  <p>I am new to stunnel and I really would like to learn how to fix this problem. Any thought or tips will be really appreciated.</p>
  
  <p>Thanks so much in advance.</p>
  
  <p>Kind regards.</p>
  
  <p>M.</p>