Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mojolicious over HTTPS

I am using Mojolicious for a web app that requires an encrypted connection, but I don't know how to add SSL support to Mojolicious.

My coworker sent me these: files domain.key, domain-bundle.crt, domain.crt

and my Mojolicious startup looks like this:

sub startup {
my $self = shift;
$self->secrets(['secretphrase']);
$self->config(hypnotoad => {listen => ['http://*:80']});

How can I add HTTPS support without having to use a reverse-proxy

like image 740
user2348668 Avatar asked Dec 09 '15 01:12

user2348668


1 Answers

Found how to do it:

sub startup {
my $self = shift;
$self->secrets(['secretphrase']);
$self->config(hypnotoad => {
      listen => ['https://*:443?cert=/etc/tls/domain.crt&key=/etc/tls/domain.key']
  });
like image 73
user2348668 Avatar answered Nov 01 '22 19:11

user2348668