CGI::A...ireSSL(3pm)
π CGI::Application::Plugin::RequireSSL β bestie edition β¨
okay so this is a User Contributed Perl Documentation page, like, the community-garden kind of docs, and the manual name up top is CGI::A...ireSSL(3pm) (it's just CGI::Application::Plugin::RequireSSL, they truncate it in the header because terminals are dramatic like that). Strap in, we're making your run modes wear a little SSL armor. π‘οΈβ¨
πΈ NAME πΈ
CGI::Application::Plugin::RequireSSL β force SSL in specified pages or modules π
π VERSION π
Version 0.04
β¨ SYNOPSIS β¨
use CGI::Application::Plugin::RequireSSL;
sub login_form :RequireSSL {
my $self = shift;
# etc
}
π¦ DESCRIPTION π¦
CGI::Application::Plugin::RequireSSL lets you protect individual run modes or whole modules with SSL. So if a plain old HTTP request comes knocking, you get to choose the vibe: either an error gets raised, or the request gets redirected to the HTTPS equivalent URL. your call, bestie π«Ά
π EXPORT π
Exported methods:
config_requiressl, mode_redirect
π USAGE π
π run mode-level protection
run mode protection is specified by the RequireSSL attribute after the method name:
sub process_login :RequireSSL {
my $self = shift;
}
π§ Module-level protection
You can protect a whole entire module by setting the 'require_ssl' parameter in your instance script:
use MyApp;
my $webapp = MyApp->new(
PARAMS => {require_ssl => 1}
);
$webapp->run();
π« Redirecting to a protected URL.
By default, an error is raised if a request is made to a protected run mode or module using HTTP. BUT, you can specify that the request is redirected to the HTTPS url by setting the rewrite_to_ssl parameter β as long as the requested method is not POST:
my $webapp = MyApp->new(
PARAMS => {rewrite_to_ssl => 1}
);
heads up bestie: this only works when the method isn't POST. no cap.
π Turning off checks.
If you need to turn off checks, simply set the ignore_check parameter when configuring the plugin (see "config_requiressl" below).
π Reverting to HTTP
Once a successful request is made to a protected run mode or module, subsequent requests to a non-protected run mode or module will revert to using HTTP. To prevent this from happening, set the parameter keep_in_ssl in the configuration (see "config_requiressl" below).
π METHODS π
β config_requiressl
Optionally configure the plugin in your cgiapp_init method
$self->config_requiressl(
keep_in_ssl => 0,
ignore_check => 0,
)
Valid parameters are:
keep_in_sslβ if set, all subsequent requests following one to a protected run mode or module will be via HTTPS. πignore_checkβ ignore SSL schecking. This is useful if your application is deployed in an environment that doesn't support SSL. π«π
π mode_redirect
This is a run mode that will be automatically called if the request should be redirected to the equivalent HTTP or HTTPS URL. You should not call it directly. like, do not. it's doing its own thing π βοΈ
π«Ά AUTHOR π«Ά
Dan Horne, "<dhorne at cpan.org>"
π BUGS π
Please report any bugs or feature requests to "bug-cgi-application-plugin-requiressl at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-RequireSSL>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
π CAVEAT π
This module been tested under the FastCGI persistent environment, but not under mod_perl. The author would apprecaute feedback from anyone who is able to test with that environment. so if that's you, pls pls pls speak up π
πΈ SUPPORT πΈ
You can find documentation for this module with the perldoc command.
perldoc CGI::Application::Plugin::RequireSSL
You can also look for information at:
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/CGI-Application-Plugin-RequireSSL>
- CPAN Ratings
<http://cpanratings.perl.org/d/CGI-Application-Plugin-RequireSSL>
- RT: CPAN's request tracker
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=CGI-Application-Plugin-RequireSSL>
- Search CPAN
<http://search.cpan.org/dist/CGI-Application-Plugin-RequireSSL>
π ACKNOWLEDGEMENTS π
- Users of the
CGI::Applicationwiki (http://www.cgi-app.org) who requested this module. y'all asked, you received π«‘ - Andy Grundman β I stole the idea of the
keep_in_sslparameter from hisCatalyst::Plugin::RequireSSLmodule. iconic behavior tbh π
π COPYRIGHT & LICENSE π
Copyright 2007 Dan Horne, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π this one's from perl v5.34.0, dated 2022-06-05, and it lives in the CGI::A...ireSSL(3pm) slot of your friendly neighborhood User Contributed Perl Documentation β¨ go forth and protect those run modes, mwah ππ¦
π¦ where this page comes from
- debian bookworm: libcgi-application-plugin-requiressl-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-application-plugin-requiressl-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-application-plugin-requiressl-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-plugin-requiressl-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-plugin-requiressl-perl 0.04-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms