Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

IO::Socket::SSL and Net::SSLeay

by r1n0ck (Initiate)
on Nov 13, 2017 at 19:17 UTC ( #1203286=perlquestion: print w/replies, xml ) Need Help??
r1n0ck has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks, I am pretty new to perl. Coming from the python world but want to learn this language. I am trying to get info on setting up a simple HTTPS server. All I want to do is setup a simple HTTPS server that will allow a client to connect and using the Net::SSLeay module, I would like to pull out the SNI host value in order to assign the proper certs to the connection. Ideally I am setting up a multi-host SSL server. Single IP address but with the ability to connect to multiple hostnames (on the same server, and will assign certs as needed). I have been reading a bit and someone told me to utilize Net::SSLeay but I am getting lost using IO::Socket::SSL and Net::SSLeay and how to connect things to pull the get_servername call from Net::SSLeay. Any and all help is greatly appreciated. I think I should have started in perl with easier test projects. Thanks. -R1n0ck

Replies are listed 'Best First'.
Re: IO::Socket::SSL and Net::SSLeay
by noxxi (Pilgrim) on Nov 14, 2017 at 06:15 UTC
    You don't need to extract the server name yourself. IO::Socket::SSL lets you setup SSL_cert* and SSL_key* as hash and thus can choose the appropriate certificates automagically. There is even example code in the documentation of IO::Socket::SSL for it.
Re: IO::Socket::SSL and Net::SSLeay
by 1nickt (Prior) on Nov 13, 2017 at 21:00 UTC

    Hi, welcome,

    Yep, do yourself a favor and start simple. Install a modern Perl web application framework such as Dancer2 , which can have you up and running with a server in one file or a skeleton application structure, in 15 minutes. Then check out the plugins for extras like HTTPS.

    Hope this helps!


    The way forward always starts with a minimal test.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1203286]
Front-paged by haukex
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (9)
As of 2017-11-22 08:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (316 votes). Check out past polls.

    Notices?