title: Setting up a Red5 server to handle RTMPS?
body: <p>I am attempting to connect to my Red5 server with an RTMP client through an SSL socket. Based on <a href="http://gregoire.org/2009/11/12/native-rtmps-in-red5/" rel="nofollow">Paul Gregoire's blog post</a> about Red5 and RTMPS, these are the steps that I took to set up a new Red5 RTMPS server:</p>
  
  <ol>
  <li>Download and install a fresh version of Red5 from the <a href="http://red5.org/downloads/red5/1_0/" rel="nofollow">Red5 1.0 download page</a></li>
  <li>Uncomment the RTMPS section of the <strong>{red5 dir}/conf/red5-core.xml</strong> file. This section contains the same settings that Paul Gregoire mentions in step 8 of his blog post.</li>
  <li>Leave the <strong>{red5 dir}/conf/red5.properties</strong> unchanged; the RTMPS port is set to the default 8443 and the server SSL keystore is left as the one packaged with Red5</li>
  </ol>
  
  <p>I then proceed to start up the Red5 server with the JVM argument "-Djavax.net.debug=ssl" so that SSL debug information will be displayed in the console. </p>
  
  <p>As a simple test, I try connecting to the server with node.js by using the tls library:</p>
  
  <pre><code>tls.connect(8443, 'localhost', null);  // tls.connect(port, host, callback);
  </code></pre>
  
  <p>The first thing I notice in the server console is line 1106:</p>
  
  <pre><code>[DEBUG] [pool-11-thread-1] org.red5.server.net.rtmp.codec.RTMPProtocolDecoder - Handshake init too small, buffering. remaining: 338
  </code></pre>
  
  <p>My first thought is that the RTMP handshake is unable to be decoded by the server because the server is skipping over the SSL handshake that the client is trying to initiate. By further combing the server console, I see that the SSL handshake never happens despite the client connecting through an SSL socket. <a href="http://pastebin.com/raw.php?i=wg4SiAD4" rel="nofollow">Here</a> is the full server console output of the result of the node.js client calling the aforementioned line.</p>
  
  <p>What am I doing wrong when trying to connect to the server through SSL and how should Red5 be set up to use RTMPS?</p>