Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^14: Need to know the process to implement perl script into web application server.

by chandantul (Scribe)
on Apr 29, 2021 at 20:43 UTC ( [id://11131892]=note: print w/replies, xml ) Need Help??


in reply to Re^13: Need to know the process to implement perl script into web application server.
in thread Need to know the process to implement perl script into web application server.

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.

Replies are listed 'Best First'.
Re^15: Need to know the process to implement perl script into web application server.
by choroba (Cardinal) on Apr 29, 2021 at 20:51 UTC
    I fear Dancer plugins don't work in Dancer2.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Sir, I have tried below command and got the error

      starman --enable-ssl --ssl-key=C:\Users\Documents\Private-Public\priva +teKey.key --ssl-cert=C:\Users\Documents\Private-Public\certificate.cr +t --workers=10 bin/app.psgi

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

      Are there any way i can utlize Apache 2.4 with Dancer 2 or How i can enable https in my existing app? Please let me know the best way.

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

        Can you post everything the starman command emits? I'm not able to reproduce your problem.

        Line 103 in the given file is

        $class->new(%args) or die "failed to listen to port $self->{port}: $!";

        where the $class should be IO::Socket::SSL.

        map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11131892]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-28 16:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found