title: Authentication and/or HTTPS with Plack/PSGI/Poet application
body: <p>I need to build a simple web-application. I decided to do it with <a href="http://search.cpan.org/~jswartz/Poet-0.13/lib/Poet.pm" rel="noreferrer">Poet</a> (<a href="http://search.cpan.org/~jswartz/Mason-2.20/lib/Mason.pm" rel="noreferrer">Mason2</a>), which uses Plack.</p>
  
  <p>The application should be allowed to use only by authenticated users, so I need build some login/password functionality.</p>
  
  <p>There already is a Plack module <a href="http://search.cpan.org/~miyagawa/Plack-1.0028/lib/Plack/Middleware/Auth/Basic.pm" rel="noreferrer">Plack::Middleware::Auth::Basic</a> that allows using Basic user auth that makes it possible to setup to check <code>.htpasswd</code> or similar. But the basic authentication is not very secure; anybody can grab the login password with packet capturing or the like.</p>
  
  <p>Here are 2 possible solutions:</p>
  
  <ul>
  <li>running my app.psgi via HTTPS(443) - link level encryption</li>
  <li>or is there some better auth method that allow secure auth without https?</li>
  </ul>
  
  <p>The questions:</p>
  
  <ul>
  <li>Regarding HTTPS - I have no idea how to run my <code>app.psgi</code> via HTTPS. Do I need to modify my application somewhat? Any link what shows me how to run <code>plackup</code> over the https?</li>
  <li>or for the second: is there some method (middleware/or perl module) what allows me build  <em>secure</em> authentication over the standard unencrypted port?(80)</li>
  </ul>
  
  <p>So, what is an relative easy way to achieve secure authentication with a Plack application?</p>
  
  <p>PS: I don't care about the rest of communication. I only need secure auth that doesn't allow to grab the passwords.</p>
  
  <p>PPS: https is easy with apache (and self-signed) certificate. But I have no idea how to do it with <code>plackup</code> (and or any other Plack based server)</p>