You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Pete Rothermel <ro...@isomedia.com> on 2002/07/14 19:56:25 UTC

[modperl2] Perl Connection Handlers for SSL connections

I've got the example echo() handler working for a non-HTTP protocol as
outlined  on the new web site:

http://perl.apache.org/docs/2.0/user/handlers/handlers.html#Command__Protocol__Phases

Anybody have a similar example for the same protocol handler over SSL?

thanks
Pete Rothermel

Re: [modperl2] Perl Connection Handlers for SSL connections

Posted by Pete Rothermel <ro...@isomedia.com>.
Stas Bekman wrote:
> 
> Pete Rothermel wrote:
> > I've got the example echo() handler working for a non-HTTP protocol as
> > outlined  on the new web site:
> >
> > http://perl.apache.org/docs/2.0/user/handlers/handlers.html#Command__Protocol__Phases
> >
> > Anybody have a similar example for the same protocol handler over SSL?
> 
> the echo protocol working over the socket skips filters, so it won't
> work with SSL.
> 
> at the above URL scroll down to the Apache::Eliza2 example, which uses
> bucket brigades and therefore should work over SSL.
> 
> I didn't have a chance to document it yet, but for simple things you
> just change the code inside this snippet:
> 
>                if ($data) {
>                    $data =~ s/[\r\n]*$//;
>                    $last++ if $data =~ /good bye/i;
>                    $data = $eliza->transform( $data ) . "\n\n";
>                    $bucket = APR::Bucket->new($data);
>                 }
> 
> the rest most likely will stay unmodified.
> 

Stas,

Worked like a charm. You might want to include an example over 
ssl in the doco. I used the openssl executable as the client 
application. 

openssl.exe s_client -connect hostip:sslport

thanks again
Pete

Re: [modperl2] Perl Connection Handlers for SSL connections

Posted by Stas Bekman <st...@stason.org>.
Pete Rothermel wrote:
> I've got the example echo() handler working for a non-HTTP protocol as
> outlined  on the new web site:
> 
> http://perl.apache.org/docs/2.0/user/handlers/handlers.html#Command__Protocol__Phases
> 
> Anybody have a similar example for the same protocol handler over SSL?

the echo protocol working over the socket skips filters, so it won't 
work with SSL.

at the above URL scroll down to the Apache::Eliza2 example, which uses 
bucket brigades and therefore should work over SSL.

I didn't have a chance to document it yet, but for simple things you 
just change the code inside this snippet:

               if ($data) {
                   $data =~ s/[\r\n]*$//;
                   $last++ if $data =~ /good bye/i;
                   $data = $eliza->transform( $data ) . "\n\n";
                   $bucket = APR::Bucket->new($data);
                }

the rest most likely will stay unmodified.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com