JezK
Edit File: stunnel.html
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>stunnel HOWTO</title><link rel="stylesheet" type="text/css" href="userguide.css" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="home" href="index.html" title="FreeTDS User Guide" /><link rel="up" href="configs.html" title="Chapter 5. Advanced Configurations" /><link rel="prev" href="tdspool.html" title="TDS Connection Pooling" /><link rel="next" href="usefreetds.html" title="Chapter 6. Use FreeTDS" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">stunnel HOWTO</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="tdspool.html">Prev</a> </td><th width="60%" align="center">Chapter 5. Advanced Configurations</th><td width="20%" align="right"> <a accesskey="n" href="usefreetds.html">Next</a></td></tr></table><hr /></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="stunnel"></a>stunnel HOWTO</h2></div></div></div><p>Contributed by <a class="ulink" href="mailto:bradleyb@u.washington.edu" target="_top">Bradley Bell</a>.</p><p>To set up <span class="productname">FreeTDS</span> over stunnel between a Linux webserver and a W2k SQL server:</p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>Get unencrypted <span class="productname">FreeTDS</span> working</p></li><li class="listitem"><p>Install openssl and stunnel on the Linux box: <a class="ulink" href="http://www.stunnel.org/" target="_top">stunnel.org</a> </p></li><li class="listitem"><p>Download the <a class="ulink" href="http://www.stunnel.org/download/binaries.html" target="_top">stunnel binary</a> and openssl dll's for Windows. </p></li><li class="listitem"><p>Generate stunnel.pem (complete with Diffie-Hellman parameters) for placement on the W2k box. See <a class="ulink" href="http://www.stunnel.org/faq/certs.html" target="_top">instructions</a> in the stunnel FAQ. </p></li><li class="listitem"><p>Start stunnel on the W2k box:</p><pre class="screen"> <code class="prompt">$ </code><strong class="userinput"><code>stunnel.exe -d 61666 -r localhost:1433</code></strong></pre><p>61666 is just an arbitrary port number. </p></li><li class="listitem"><p>Start stunnel on the Linux box:</p><pre class="screen"> <code class="prompt">$ </code><strong class="userinput"><code>stunnel -c -d 1433 -r <em class="replaceable"><code>win2kserver</code></em>:61666</code></strong></pre><p>where <em class="replaceable"><code>win2kserver</code></em> is the hostname or IP address of the W2k box. </p></li><li class="listitem"><p>Set up <span class="productname">FreeTDS</span> to use the tunnel. If this is your unencrypted entry in <code class="filename">freetds.conf</code>:</p><div class="example"><a id="e.g.Unencrypted"></a><p class="title"><strong>Example 5.9. Unencrypted entry in <code class="filename">freetds.conf</code></strong></p><div class="example-contents"><pre class="programlisting"> [win2kserver] host = win2kserver port = 1433 </pre></div></div><br class="example-break" /><p> the encrypted equivalent uses:</p><div class="example"><a id="e.g.Encrypted"></a><p class="title"><strong>Example 5.10. Encrypted entry in <code class="filename">freetds.conf</code></strong></p><div class="example-contents"><pre class="programlisting"> [win2kserver] host = localhost port = 1433 </pre></div></div><br class="example-break" /></li></ol></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tdspool.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="configs.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="usefreetds.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">TDS Connection Pooling </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 6. Use <span class="productname">FreeTDS</span> </td></tr></table></div></body></html>