Currently the webapp running in http but i would like to enable SSL in order to run the webapp in https protocol

I have tried below but getting below error

C:\Users\Documents\Perl\webapp\bin>plackup --enable-ssl --ssl-key-file +=C:\Users\Documents\Private-Public\privateKey.key --ssl-cert-file=C:\ +Users\Documents\Private-Public\certificate.crt app.psgi

failed to listen to port 5000: Invalid argument at C:/Strawberry/perl/site/lib/HTTP/Server/PSGI.pm line 103.

Please check i have installed the following module as well Dancer::Plugin::RequireSSL; and made the changes in webapp

package webapp; use Dancer2; use Dancer::Plugin::RequireSSL; use Op; our $VERSION = '0.1'; require_ssl(); get '/' => sub { template 'query' => { 'title' => 'webapp' }; }; post '/' => sub { my $r = Op::result({APPID => param('APPID'), date => param('date'), Email => param('Email')}); template result => { title => 'webapp', result => $r } }; true;

Are there any solution to get the https://localhost:5000 working?

2021-05-01 Athanasius fixed over-long code line.


In reply to Re^14: Need to know the process to implement perl script into web application server. by chandantul
in thread Need to know the process to implement perl script into web application server. by chandantul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.