[32556] in Perl-Users-Digest
Perl-Users Digest, Issue: 3822 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 22 09:09:29 2012
Date: Thu, 22 Nov 2012 06:09:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 22 Nov 2012 Volume: 11 Number: 3822
Today's topics:
Detecting sub/call mismatches? (Tim McDaniel)
Re: Detecting sub/call mismatches? <derykus@gmail.com>
Re: Detecting sub/call mismatches? (Tim McDaniel)
Re: Detecting sub/call mismatches? <rweikusat@mssgmbh.com>
Re: Detecting sub/call mismatches? <ben@morrow.me.uk>
help with references <rodbass63@gmail.com>
Re: help with references <rweikusat@mssgmbh.com>
Re: help with references <news@lawshouse.org>
Re: help with references <jurgenex@hotmail.com>
Re: help with references <jurgenex@hotmail.com>
Re: IO::Select and PerlIO <ben@morrow.me.uk>
Re: IO::Select and PerlIO <rweikusat@mssgmbh.com>
Re: IO::Select and PerlIO <hjp-usenet2@hjp.at>
Re: IO::Select and PerlIO <hjp-usenet2@hjp.at>
Trying to get SSL with client cert to work within POE e patrick.viet@gmail.com
Re: Trying to get SSL with client cert to work within P <ben@morrow.me.uk>
Re: Trying to get SSL with client cert to work within P patrick.viet@learnosity.com
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 21 Nov 2012 03:07:11 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Detecting sub/call mismatches?
Message-Id: <k8hggu$a1i$1@reader1.panix.com>
I'm moving subs from one source file to another, and sometimes
renaming them according to a more unified naming convention, so
OldModule::OldName
OldName (while in package OldModule)
should all be changed to NewModule::NewName.
The problem, of course, is when I screw up a call to some version of
the old name, which (so far) has ended up as
OldModule::OldName (that is, I overlooked it entirely)
OldModule::NewName
OldName (while in package OldModule; overlooked)
NewName (while in package OldModule, so that's OldModule::NewName)
I've caught these by eyeball inspection and I'll go thru it again, but
I'm nervous.
In Perl, of course, you can't in general do a static "compile time"
check -- in principle, there could be a sub defined with eval, a
reference to a sub, a sub name generated by code, et cetera.
Nevertheless, even if I can't get perfection, I'd like to do some
static verification if it's possible -- a Perl lint, for those
familiar with the old C tool. In practice, our code rarely does
obscure things. All I've seen are package declarations alone on a
line, and "sub SomeName *{" starting in column 1, and calls to
SomeModule:SomeName, except within SomeModule, where we usually do
just SomeName.
Is there anything I can do to get a partial check?
I've thought of hacking together a script that reads source files to
look for package and sub declarations to generate a table of potential
definitions, and the uses are every word that is followed by a left
paren. I could get some false results due to not following the proper
parsing (is there a module to parse Perl code?), like misunderstanding
quotation or comments. But even if I find one error now instead of
several weeks from now when some obscure path is finally run, and get
a slew of bad hits, I'd be happier.
--
Tim McDaniel, tmcd@panix.com
------------------------------
Date: Tue, 20 Nov 2012 19:38:41 -0800 (PST)
From: "C.DeRykus" <derykus@gmail.com>
Subject: Re: Detecting sub/call mismatches?
Message-Id: <43ad4a1e-1ff3-49c7-a07f-b31ea250e2ca@googlegroups.com>
On Tuesday, November 20, 2012 7:07:11 PM UTC-8, Tim McDaniel wrote:
> I'm moving subs from one source file to another, and sometimes
>
> renaming them according to a more unified naming convention, so
>
> OldModule::OldName
>
> OldName (while in package OldModule)
>
> should all be changed to NewModule::NewName.
>
>
>
> The problem, of course, is when I screw up a call to some version of
>
> the old name, which (so far) has ended up as
>
> OldModule::OldName (that is, I overlooked it entirely)
>
> OldModule::NewName
>
> OldName (while in package OldModule; overlooked)
>
> NewName (while in package OldModule, so that's OldModule::NewName)
>
> I've caught these by eyeball inspection and I'll go thru it again, but
>
> I'm nervous.
>
>
>
> In Perl, of course, you can't in general do a static "compile time"
>
> check -- in principle, there could be a sub defined with eval, a
>
> reference to a sub, a sub name generated by code, et cetera.
>
>
>
> Nevertheless, even if I can't get perfection, I'd like to do some
>
> static verification if it's possible -- a Perl lint, for those
>
> familiar with the old C tool. In practice, our code rarely does
>
> obscure things. All I've seen are package declarations alone on a
>
> line, and "sub SomeName *{" starting in column 1, and calls to
>
> SomeModule:SomeName, except within SomeModule, where we usually do
>
> just SomeName.
>
>
>
> Is there anything I can do to get a partial check?
>
>
>
> I've thought of hacking together a script that reads source files to
>
> look for package and sub declarations to generate a table of potential
>
> definitions, and the uses are every word that is followed by a left
>
> paren. I could get some false results due to not following the proper
>
> parsing (is there a module to parse Perl code?), like misunderstanding
>
> quotation or comments. But even if I find one error now instead of
>
> several weeks from now when some obscure path is finally run, and get
>
> a slew of bad hits, I'd be happier.
>
>
B::Xref might help - perldoc B::Xref
--
Charles DeRykus
------------------------------
Date: Wed, 21 Nov 2012 06:33:09 +0000 (UTC)
From: tmcd@panix.com (Tim McDaniel)
Subject: Re: Detecting sub/call mismatches?
Message-Id: <k8hsj5$o5p$1@reader1.panix.com>
In article <43ad4a1e-1ff3-49c7-a07f-b31ea250e2ca@googlegroups.com>,
>B::Xref might help - perldoc B::Xref
Interesting -- thank you for the pointer.
It's strange, though, that /^File / lines are so odd:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
File
Subroutine (definitions)
...
File ^E
Subroutine (definitions)
Package Moose::Error::Util
&_create_error_carpmess s26
&create_error s43
&create_error_confess s34
&create_error_croak s30
File<EB>}
Subroutine (definitions)
...
File
2Bh^W
Subroutine (definitions)
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--
Tim McDaniel, tmcd@panix.com
------------------------------
Date: Wed, 21 Nov 2012 16:40:07 +0000
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: Detecting sub/call mismatches?
Message-Id: <874nkiap08.fsf@sapphire.mobileactivedefense.com>
tmcd@panix.com (Tim McDaniel) writes:
> I'm moving subs from one source file to another, and sometimes
> renaming them according to a more unified naming convention, so
> OldModule::OldName
> OldName (while in package OldModule)
> should all be changed to NewModule::NewName.
>
> The problem, of course, is when I screw up a call to some version of
> the old name, which (so far) has ended up as
> OldModule::OldName (that is, I overlooked it entirely)
> OldModule::NewName
> OldName (while in package OldModule; overlooked)
> NewName (while in package OldModule, so that's OldModule::NewName)
> I've caught these by eyeball inspection and I'll go thru it again, but
> I'm nervous.
>
> In Perl, of course, you can't in general do a static "compile time"
> check -- in principle, there could be a sub defined with eval, a
> reference to a sub, a sub name generated by code, et cetera.
>
> Nevertheless, even if I can't get perfection, I'd like to do some
> static verification if it's possible -- a Perl lint, for those
> familiar with the old C tool.
You could try B::Lint.
------------------------------
Date: Wed, 21 Nov 2012 17:17:33 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Detecting sub/call mismatches?
Message-Id: <duevn9-p0k2.ln1@anubis.morrow.me.uk>
Quoth tmcd@panix.com:
> I'm moving subs from one source file to another, and sometimes
> renaming them according to a more unified naming convention, so
> OldModule::OldName
> OldName (while in package OldModule)
> should all be changed to NewModule::NewName.
>
> The problem, of course, is when I screw up a call to some version of
> the old name, which (so far) has ended up as
> OldModule::OldName (that is, I overlooked it entirely)
> OldModule::NewName
> OldName (while in package OldModule; overlooked)
> NewName (while in package OldModule, so that's OldModule::NewName)
> I've caught these by eyeball inspection and I'll go thru it again, but
> I'm nervous.
>
> In Perl, of course, you can't in general do a static "compile time"
> check -- in principle, there could be a sub defined with eval, a
> reference to a sub, a sub name generated by code, et cetera.
>
> Nevertheless, even if I can't get perfection, I'd like to do some
> static verification if it's possible -- a Perl lint, for those
> familiar with the old C tool. In practice, our code rarely does
> obscure things. All I've seen are package declarations alone on a
> line, and "sub SomeName *{" starting in column 1, and calls to
> SomeModule:SomeName, except within SomeModule, where we usually do
> just SomeName.
>
> Is there anything I can do to get a partial check?
Assuming your program will run through 'perl -c' without doing anything
untoward (this isn't given, but can be arranged), you can use B::Lint.
~% perl -MO=Lint -e'foo()'
Nonexistent subroutine 'foo' called at -e line 1
-e syntax OK
IMHO most of the checks Lint makes are annoying and useless, so you may
want to turn off everything except calls to nonexistent subs.
> I've thought of hacking together a script that reads source files to
> look for package and sub declarations to generate a table of potential
> definitions, and the uses are every word that is followed by a left
> paren. I could get some false results due to not following the proper
> parsing (is there a module to parse Perl code?),
There is PPI. It is not perfect (parsing Perl without executing it is
logically impossible) but it does a pretty good job.
Also, you need a test suite. Once you have tests that exercise all the
paths through your code, you can run the suite and then be reasonably
sure you won't get any more surprises.
Ben
------------------------------
Date: Wed, 21 Nov 2012 04:48:42 -0800 (PST)
From: Nene <rodbass63@gmail.com>
Subject: help with references
Message-Id: <0eab7896-f5f4-4063-a124-09e4ca3ea829@googlegroups.com>
Hi
I have this variable in my script that produced this data:
{
'reason_for_account' => 'tempaccounts',
'username' => 'narf',
'useruuid' => 'blahblah',
'created' => '2012-11-18 15:57:35',
'password' => '1232132',
'tempaccount' => '947A60EA-31C2-11E2-8C75-A6A7C6D72CC8',
'context' => '{ FTPStuff }',
'id' => '12',
'type' => 'Cabbage'
}
I was able to produce the data above by this:
my @data = \$ret;
print Dumper(@data);
But I need to grab the value to the key 'tempaccount' and put it in a variable.
How do I do that?
usaims
------------------------------
Date: Wed, 21 Nov 2012 13:26:34 +0000
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: help with references
Message-Id: <87wqxf2jmx.fsf@sapphire.mobileactivedefense.com>
Nene <rodbass63@gmail.com> writes:
> I have this variable in my script that produced this data:
>
> {
> 'reason_for_account' => 'tempaccounts',
> 'username' => 'narf',
> 'useruuid' => 'blahblah',
> 'created' => '2012-11-18 15:57:35',
> 'password' => '1232132',
> 'tempaccount' => '947A60EA-31C2-11E2-8C75-A6A7C6D72CC8',
> 'context' => '{ FTPStuff }',
> 'id' => '12',
> 'type' => 'Cabbage'
> }
>
> I was able to produce the data above by this:
>
> my @data = \$ret;
> print Dumper(@data);
>
> But I need to grab the value to the key 'tempaccount' and put it in
> a variable.
It is not entirely clear if your script produces this text or of this
is something Data::Dumper generated based on the input data. In any
case, this thing above is what the perlref manpage calls 'an anonymous
hash composer', cf
,----
| [rw@sapphire]~ $perl -e '$h = { a => b }; print $h, "\n";'
| HASH(0x605d48)
`----
And for the simple case[*], the elements are accessed just like hash
elements except that the reference needs to be dereferenced. This
looks like this:
,----
| [rw@sapphire]~ $perl -e '$h = { a => b }; print $h->{a}, "\n";'
| b
`----
In your case, that would be $ret->{tempaccount}.
[*] Considering the gory details, as described in the 'Using
References' section of the perlref manpage, this description is quite
of an understatement and (as seems very likely) if you'll never need
to write code for a perl old enough that it doesn't know about ->,
consider yourself "blissfully ignorant" of stuff no one really wanted
to learn :->. [**]
[**] Sufficiently new perls (since 5.14, IIRC), have
thankfully started to eliminate @{${$_[0]}} and friends from the more
common use cases but that's just an outlook into a possibly nicer
future at the moment.
------------------------------
Date: Wed, 21 Nov 2012 15:11:57 +0000
From: Henry Law <news@lawshouse.org>
Subject: Re: help with references
Message-Id: <o-ydnaXV78KjcjHNnZ2dnUVZ8r-dnZ2d@giganews.com>
On 21/11/12 12:48, Nene wrote:
> Hi
>
> I have this variable in my script that produced this data:
>
> {
> 'reason_for_account' => 'tempaccounts',
> 'username' => 'narf',
> 'useruuid' => 'blahblah',
> 'created' => '2012-11-18 15:57:35',
> 'password' => '1232132',
> 'tempaccount' => '947A60EA-31C2-11E2-8C75-A6A7C6D72CC8',
> 'context' => '{ FTPStuff }',
> 'id' => '12',
> 'type' => 'Cabbage'
> }
>
> I was able to produce the data above by this:
>
> my @data = \$ret;
> print Dumper(@data);
As a devotee of Data::Dumper I can say categorically that, whatever
you've dumped out above, it's not an array called @data, or
@anythingelse either; it's a hash. And I don't see how you can have
created a hash by assigning a reference to a scalar (\$ret) to an array.
Could we see some real code, preferably something that runs, so we can
help you better?
(In general if you have a hash called %name then individual data values
are referred to by $name{keyvalue}. This is basic Perl.)
--
Henry Law Manchester, England
------------------------------
Date: Wed, 21 Nov 2012 08:27:27 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: help with references
Message-Id: <klvpa8lnpmda7t0g35r0p5mpgg08ntvgpr@4ax.com>
Nene <rodbass63@gmail.com> wrote:
>I have this variable in my script that produced this data:
Variables contain data, they don't produce it.
It would have been of great help if you would have included the
definition of this variable, such that we can actually run it ourselves.
I am assuming it is probably something like
my $ret = {
> 'reason_for_account' => 'tempaccounts',
> 'username' => 'narf',
> 'useruuid' => 'blahblah',
> 'created' => '2012-11-18 15:57:35',
> 'password' => '1232132',
> 'tempaccount' => '947A60EA-31C2-11E2-8C75-A6A7C6D72CC8',
> 'context' => '{ FTPStuff }',
> 'id' => '12',
> 'type' => 'Cabbage'
> }
which would make $ret a reference to an anonymous hash.
>I was able to produce the data above by this:
>
>my @data = \$ret;
>print Dumper(@data);
>
>But I need to grab the value to the key 'tempaccount' and put it in a variable.
Just dereference (see "perldoc perlreftut" and "perldoc perlref") the
reference and select the element from the hash:
$thisaccount = $ret->{tempaccount};
jue
------------------------------
Date: Wed, 21 Nov 2012 08:31:34 -0800
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: help with references
Message-Id: <v70qa8t0m9gult0u8k5r26str28tjtqti6@4ax.com>
Henry Law <news@lawshouse.org> wrote:
>On 21/11/12 12:48, Nene wrote:
>> Hi
>>
>> I have this variable in my script that produced this data:
>>
>> {
>> 'reason_for_account' => 'tempaccounts',
>> 'username' => 'narf',
>> 'useruuid' => 'blahblah',
>> 'created' => '2012-11-18 15:57:35',
>> 'password' => '1232132',
>> 'tempaccount' => '947A60EA-31C2-11E2-8C75-A6A7C6D72CC8',
>> 'context' => '{ FTPStuff }',
>> 'id' => '12',
>> 'type' => 'Cabbage'
>> }
>>
>> I was able to produce the data above by this:
>>
>> my @data = \$ret;
>> print Dumper(@data);
>
>As a devotee of Data::Dumper I can say categorically that, whatever
>you've dumped out above, it's not an array called @data, or
>@anythingelse either; it's a hash.
...which in the old days used to be called an associative array.
>Could we see some real code, preferably something that runs, so we can
>help you better?
That of course is always a very good idea.
jue
------------------------------
Date: Thu, 22 Nov 2012 07:22:47 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: IO::Select and PerlIO
Message-Id: <7f01o9-3iv2.ln1@anubis.morrow.me.uk>
Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
> Does IO::Select take into account data buffered by PerlIO?
>
> Specifically, I would like to do something like the following:
>
> my $s = IO::Select->new();
> $s->add($socket_fh);
>
> while (...) {
> print $socket_fh "$request\n";
>
> while ($s->can_read(0)) {
Thinking a little more about this, would something like this be
sufficient?
use IO::Pending qw/pending_read/;
while (pending_read($socket_fh) || $s->can_read(0)) {
PerlIO provides the information at the C level, so it shouldn't be too
hard to export it to Perl, at least for real PerlIO filehandles. (For
tied filehandles all bets are off.)
Ben
------------------------------
Date: Thu, 22 Nov 2012 13:13:10 +0000
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: IO::Select and PerlIO
Message-Id: <87k3tdvl09.fsf@sapphire.mobileactivedefense.com>
Ben Morrow <ben@morrow.me.uk> writes:
> Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
>> Does IO::Select take into account data buffered by PerlIO?
>>
>> Specifically, I would like to do something like the following:
>>
>> my $s = IO::Select->new();
>> $s->add($socket_fh);
>>
>> while (...) {
>> print $socket_fh "$request\n";
>>
>> while ($s->can_read(0)) {
This is broken and will likely just hang (or loop) forever: The remote
server won't send any data until it has received a request and the
intermediate buffering layer won't send any data until the buffer has
been filled, cf the 'webget client' section in perlipc. At the very
least, the handle needs to be configured to flush everything out as
soon as it was written or the calling code needs to do explicit
flushes once a complete request has been copied to the intermediate
buffer (for whatever reason).
> Thinking a little more about this, would something like this be
> sufficient?
>
> use IO::Pending qw/pending_read/;
>
> while (pending_read($socket_fh) || $s->can_read(0)) {
>
> PerlIO provides the information at the C level, so it shouldn't be too
> hard to export it to Perl, at least for real PerlIO filehandles. (For
> tied filehandles all bets are off.)
This whole approach is fundamentally wrong and there's no point in
trying to make it work somehow: Communication with a process on
another computer somewhere 'on the internet' is something which
happens in 'real time', as opposed to writing data to a block device,
and the best thing the intermediate buffering layer provides for this
case is that it requires an additional copy of all data which is
either sent or received if it is tendered properly, that is, it makes
the programmer work more in order to achieve a technically worse
result.
There's (or used to be) a nice comment somewhere in the Samba sources
which was roughly "We have to get over our fprintf habit!". That
should be authoritative enough even for the most academic academic
mind which will not listen to anything which doesn't come from some
Prof Dr Dr Dr (and will accept everything the latter says, no matter
how nonsensical).
------------------------------
Date: Thu, 22 Nov 2012 14:58:16 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: IO::Select and PerlIO
Message-Id: <slrnkasbro.lqo.hjp-usenet2@hrunkner.hjp.at>
On 2012-11-22 07:22, Ben Morrow <ben@morrow.me.uk> wrote:
> Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
>> Does IO::Select take into account data buffered by PerlIO?
>>
>> Specifically, I would like to do something like the following:
>>
>> my $s = IO::Select->new();
>> $s->add($socket_fh);
>>
>> while (...) {
>> print $socket_fh "$request\n";
>>
>> while ($s->can_read(0)) {
>
> Thinking a little more about this, would something like this be
> sufficient?
>
> use IO::Pending qw/pending_read/;
>
> while (pending_read($socket_fh) || $s->can_read(0)) {
Is this an idea for a new module? IO::Pending doesn't seem to exist.
Yes, that sounds useful.
> PerlIO provides the information at the C level, so it shouldn't be too
> hard to export it to Perl, at least for real PerlIO filehandles.
I'll have a look at it.
hp
--
_ | Peter J. Holzer | Fluch der elektronischen Textverarbeitung:
|_|_) | Sysadmin WSR | Man feilt solange an seinen Text um, bis
| | | hjp@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/ | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
------------------------------
Date: Thu, 22 Nov 2012 15:01:30 +0100
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: IO::Select and PerlIO
Message-Id: <slrnkasc1q.lqo.hjp-usenet2@hrunkner.hjp.at>
On 2012-11-22 13:13, Rainer Weikusat <rweikusat@mssgmbh.com> wrote:
> Ben Morrow <ben@morrow.me.uk> writes:
>> Quoth "Peter J. Holzer" <hjp-usenet2@hjp.at>:
>>> Does IO::Select take into account data buffered by PerlIO?
>>>
>>> Specifically, I would like to do something like the following:
>>>
>>> my $s = IO::Select->new();
>>> $s->add($socket_fh);
>>>
>>> while (...) {
>>> print $socket_fh "$request\n";
>>>
>>> while ($s->can_read(0)) {
>
> This is broken and will likely just hang (or loop) forever: The remote
> server won't send any data until it has received a request and the
> intermediate buffering layer won't send any data until the buffer has
> been filled,
Autoflush is enabled for sockets and has been for a long time.
> cf the 'webget client' section in perlipc.
This is out of date.
[Rest deleted. Really, Rainer, you start to sound like Detlef Bosau's
twin brother]
hp
--
_ | Peter J. Holzer | Fluch der elektronischen Textverarbeitung:
|_|_) | Sysadmin WSR | Man feilt solange an seinen Text um, bis
| | | hjp@hjp.at | die Satzbestandteile des Satzes nicht mehr
__/ | http://www.hjp.at/ | zusammenpaßt. -- Ralph Babel
------------------------------
Date: Wed, 21 Nov 2012 21:51:37 -0800 (PST)
From: patrick.viet@gmail.com
Subject: Trying to get SSL with client cert to work within POE environment
Message-Id: <e2c09052-b818-40b8-bfb7-517f2d39ae5a@googlegroups.com>
Dear fellow perl users,
Here is a problem I've been trying to tackle since about 2007. I figured ma=
ybe someone on this group might know.
I'm trying to establish some SSL connection with self signed server and cli=
ent certs between server and client, to establish encrypted authentication =
between different bits of software. These are daemons so I use the POE libr=
ary.
I managed to do what I wanted in JavaScript with node.JS:
var sslcert =3D fs.readFileSync('mycert.pem');
var sslkey =3D fs.readFileSync('mykey.pem');
var sslca =3D fs.readFileSync('ca.pem');
var options =3D { cert: sslcert, key: sslkey, ca: sslca, ... other options =
... };
options.agent =3D new https.Agent(options);
var req =3D https.request(options, function(res) {
s =3D req.socket;
if(!s.authorized) { my_callback('SSL API ERROR '+s.authorizationError); r=
eturn; }
// the remote end was OK
...
No need to expand, just to give an idea of what I'm doing. I really want to=
do it with perl, node isn't mature enough yet in my experience and particu=
larly with the libs I use, whereas perl mostly is.
Now I found how to do it with perl and cURL lib, but it's synchronous singl=
e thread, and I'd have to fork a separate interpreter to handle my connecti=
ons. I tried with LWP just for kicks and kept getting some negotiations err=
ors. At least cURL worked.
Anyway, I found this module: POE::Component::SSLify.
Within the options, I can set a client cert, and a client key
http://search.cpan.org/~apocal/POE-Component-SSLify-1.008/lib/POE/Component=
/SSLify.pm#SSLify_ContextCreate
But nowhere can I choose to verify things against a specific certificate au=
thority or check for the cert of the server I'm connecting to.
Any ideas of how I could do that or find where to do it? Been looking on an=
d off since 2007...=20
I really don't want to have to resort to porting the app to node.js to get =
SSL, because honestly it's a nightmare to debug and the libs are still chan=
ging, not to mention well written perl is so much cleaner than these piles =
of async callbacks that node imposes.
Thanks so much all in advance for your great ideas.
Cheers
--=20
Patrick Viet
------------------------------
Date: Thu, 22 Nov 2012 07:10:53 +0000
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Trying to get SSL with client cert to work within POE environment
Message-Id: <tov0o9-ucv2.ln1@anubis.morrow.me.uk>
Quoth patrick.viet@gmail.com:
> Dear fellow perl users,
>
> Here is a problem I've been trying to tackle since about 2007. I figured
> maybe someone on this group might know.
>
> I'm trying to establish some SSL connection with self signed server and
> client certs between server and client, to establish encrypted
> authentication between different bits of software. These are daemons so
> I use the POE library.
<snip>
>
> Anyway, I found this module: POE::Component::SSLify.
> Within the options, I can set a client cert, and a client key
<snip>
>
> But nowhere can I choose to verify things against a specific certificate
> authority or check for the cert of the server I'm connecting to.
POE::Filter::SSL appears to have explicit support for verifying client
certificates against a custom CA. If you'd rather stick with SSLify, it
looks to me like you want to create a custom SSL context (using the
Net::SSLeay CTX_* functions) which will allow you to set any options you
like.
Ben
------------------------------
Date: Wed, 21 Nov 2012 23:52:46 -0800 (PST)
From: patrick.viet@learnosity.com
Subject: Re: Trying to get SSL with client cert to work within POE environment
Message-Id: <02292601-08c0-48c0-8e49-0397d24bca33@googlegroups.com>
On Thursday, November 22, 2012 6:18:03 PM UTC+11, Ben Morrow wrote:
> POE::Filter::SSL appears to have explicit support for verifying client
> certificates against a custom CA. If you'd rather stick with SSLify, it
> looks to me like you want to create a custom SSL context (using the
> Net::SSLeay CTX_* functions) which will allow you to set any options you
As long as it works and it stays within the unique perl process embedding P=
OE (I'm going to handle quite a bit of simultaneous connections), I'm happy=
with it. I'll dig in that direction, I didn't know about the SSL filter, a=
ll I ever used up to now were the line and http filter.
Then I might hit some kind of difficulty with the select/poll based event m=
anager, hopefully I can get epoll to work...
Thanks,
Cheers
--
Patrick Viet
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 3822
***************************************