<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle18
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-AU" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">Ho, <o:p>
</o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">But that does not account for the A ->[TLS] ->B part.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">I believe that my sample will listen for unencrypted connection only.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> stunnel-users [mailto:stunnel-users-bounces@stunnel.org]
<b>On Behalf Of </b>Vincent Deschenes<br>
<b>Sent:</b> Thursday, 9 November 2017 3:16 PM<br>
<b>To:</b> Igor Gatis <igorgatis@gmail.com>; stunnel-users@stunnel.org<br>
<b>Subject:</b> Re: [stunnel-users] TLS "translation" & 2-way auth<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">You need to have a section in your config file which listen for requests but also have the “client = yes” option with a cert and key like this:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">[http_a_to_c]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">client = yes<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">accept = port_number_to_listen_on_server_b<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">connect = server_c_address:443<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">cert = certificate.crt<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">key = private.key<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">cert and key are the certificate and private key server B uses to identify itself on server C.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">You could also add more options to specify a trustore to specify which cert coming from server C server B will trust, otherwise server B will simply allow the connection.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US">Good Luck<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> stunnel-users [<a href="mailto:stunnel-users-bounces@stunnel.org">mailto:stunnel-users-bounces@stunnel.org</a>]
<b>On Behalf Of </b>Igor Gatis<br>
<b>Sent:</b> Thursday, 9 November 2017 1:14 PM<br>
<b>To:</b> <a href="mailto:stunnel-users@stunnel.org">stunnel-users@stunnel.org</a><br>
<b>Subject:</b> [stunnel-users] TLS "translation" & 2-way auth<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Consider scenario below:<o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Server A ==TLS==> Server B ==TLS+2WayAuth==> Server C<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Server A needs to connect to Server C through Server B which runs Stunnel. Server C requires 2-way authentication. I have full control over Server A and Server B and Server C belongs to a third-party.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">What does Stunnel config should look like?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</body>
</html>