Mojolicious over HTTPS

纵然是瞬间 提交于 2019-12-04 11:37:41

问题


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


回答1:


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']
  });


来源:https://stackoverflow.com/questions/34169375/mojolicious-over-https

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!