http://www.perlmonks.org?node_id=901554


in reply to SSL with HTTP::Server::Simple and Net::Server

caveat: I have never used this package before

Did you look at the accept_hook sub-class method? The example on the page is for almost exactly what you are trying to do. If you don't mind embedding your key files directly there, that might be the way to go.

fnord

  • Comment on Re: SSL with HTTP::Server::Simple and Net::Server

Replies are listed 'Best First'.
Re^2: SSL with HTTP::Server::Simple and Net::Server
by Tanktalus (Canon) on Apr 27, 2011 at 15:15 UTC

    Yes, I did try that. However, and I should have said it originally, I traced it through the code, and accept_hook is only called when not using Net::Server. That is, when using the default built-in server. At first I thought this was a bug. However, then I discovered Net::Server::Proto::SSLEAY, and realised that the way to use Net::Server with HTTP::Server::Simple was to get Net::Server to do the protocol handling instead. Having spent ~4 hours trying to get all this to work with SSL meant that I missed some stuff in my explanation - my apologies for that.

    In fact, it was precisely this example in the doc that made me happy about tye's suggestion to use it in the first place, as it looked like only a few lines of code to get SSL working. Instead, I'm likely to have to at least open a defect against HTTP::Server::Simple to clarify the docs that this is not used in Net::Server integration.