Codebase list libpoe-component-sslify-perl / upstream/1.003
[svn-upgrade] new version libpoe-component-sslify-perl (1.003) Jonathan Yu 13 years ago
12 changed file(s) with 141 addition(s) and 73 deletion(s). Raw diff Collapse all Expand all
2323 'Apocalypse <APOCAL@cpan.org>'
2424 ],
2525 'dist_name' => 'POE-Component-SSLify',
26 'dist_version' => '1.002',
26 'dist_version' => '1.003',
2727 'license' => 'perl',
2828 'module_name' => 'POE::Component::SSLify',
2929 'recommends' => {},
3131 'requires' => {
3232 'Exporter' => '0',
3333 'IO::Handle' => '1.28',
34 'Net::SSLeay' => '0',
34 'Net::SSLeay' => '1.36',
3535 'Symbol' => '0',
36 'perl' => '5.006',
37 'vars' => '0'
36 'perl' => '5.006'
3837 },
3938 'script_files' => []
4039 );
00 Revision history for Perl extension POE::Component::SSLify.
1
2 1.003
3 Released: 2011-02-28 15:52:24 UTC
4
5 Add $IGNORE_SSL_ERRORS to ignore certain SSL errors, thanks MNUNBERG - RT#66130
6 Remove prereq on vars.pm as it's obsolete
17
28 1.002
39 Released: 2011-02-20 04:23:48 UTC
410
5 Add SSLify_GetSSL to get the Net::SSLeay object, thanks mordy@irc!
11 Add SSLify_GetSSL to get the Net::SSLeay object, thanks MNUNBERG!
612
713 1.001
814 Released: 2011-02-13 18:11:07 UTC
1319 Released: 2011-02-13 00:06:14 UTC
1420
1521 Converted to Dist::Zilla for the release process!
16 Add a test for in-situ sslification, thanks mordy@irc!
22 Add a test for in-situ sslification, thanks MNUNBERG!
1723 Add prereq for IO::Handle 1.28 to get sane $socket->blocking( 0 ) behavior on MSWin32
1824 Remove crufty old code for nonblocking and use $socket->blocking() instead
1925
00 ==============================
11 9999-99-99 99:99:99 +0000 HEAD
22 ==============================
3
4 commit 367645dabcbc3ca12aae0c32d7a2e8847274865e
5 Author: Apocalypse <perl@0ne.us>
6 Date: Mon Feb 28 08:51:38 2011 -0700
7
8 add note about MSWin32
9
10 commit 8dfc5acbbad45910fc93a6688661fb5c46cffd59
11 Author: Apocalypse <perl@0ne.us>
12 Date: Mon Feb 28 08:46:09 2011 -0700
13
14 add IGNORE_SSL_ERRORS, thanks MNUNBERG
15
16 commit cf26ebeb385b4a44dd20a1fa877905e3b948fd74
17 Author: Apocalypse <perl@0ne.us>
18 Date: Mon Feb 21 00:01:02 2011 -0700
19
20 add explicit Net::SSLeay version req
21
22 =======================================
23 2011-02-19 21:24:02 -0700 release-1.002
24 =======================================
25
26 commit e20a8d5cd43978e14b22d50b884edc14f06a72c6
27 Author: Apocalypse <perl@0ne.us>
28 Date: Sat Feb 19 21:24:02 2011 -0700
29
30 New CPAN release of POE-Component-SSLify - v1.002
31
32 Released: 2011-02-20 04:23:48 UTC
33
34 Add SSLify_GetSSL to get the Net::SSLeay object, thanks mordy@irc!
335
436 commit b4269ddff7e04f09a8f304891469fbdc962e740c
537 Author: Apocalypse <perl@0ne.us>
3434 "requires" : {
3535 "Exporter" : 0,
3636 "IO::Handle" : "1.28",
37 "Net::SSLeay" : 0,
37 "Net::SSLeay" : "1.36",
3838 "Symbol" : 0,
39 "perl" : "5.006",
40 "vars" : 0
39 "perl" : "5.006"
4140 }
4241 },
4342 "test" : {
5554 "provides" : {
5655 "POE::Component::SSLify" : {
5756 "file" : "lib/POE/Component/SSLify.pm",
58 "version" : "1.002"
57 "version" : "1.003"
5958 },
6059 "POE::Component::SSLify::ClientHandle" : {
6160 "file" : "lib/POE/Component/SSLify/ClientHandle.pm",
62 "version" : "1.002"
61 "version" : "1.003"
6362 },
6463 "POE::Component::SSLify::ServerHandle" : {
6564 "file" : "lib/POE/Component/SSLify/ServerHandle.pm",
66 "version" : "1.002"
65 "version" : "1.003"
6766 }
6867 },
6968 "release_status" : "stable",
8281 "web" : "http://github.com/apocalypse/perl-poe-sslify"
8382 }
8483 },
85 "version" : "1.002",
84 "version" : "1.003",
8685 "x_BuiltWith" : {
8786 "modules" : {
8887 "Exporter" : "5.63",
9796 "Socket" : "1.80",
9897 "Symbol" : "1.06",
9998 "Test::More" : "0.96",
100 "perl" : "NA(skipped: perl)",
101 "vars" : "1.01"
99 "perl" : "NA(skipped: perl)"
102100 },
103101 "perl" : {
104102 "original" : "v5.10.0",
117115 {
118116 "class" : "Dist::Zilla::Plugin::Git::NextVersion",
119117 "name" : "@Apocalyptic/Git::NextVersion",
120 "version" : "1.103470"
118 "version" : "1.110500"
121119 },
122120 {
123121 "class" : "Dist::Zilla::Plugin::GatherDir",
301299 {
302300 "class" : "Dist::Zilla::Plugin::Git::Check",
303301 "name" : "@Apocalyptic/Git::Check",
304 "version" : "1.103470"
302 "version" : "1.110500"
305303 },
306304 {
307305 "class" : "Dist::Zilla::Plugin::ConfirmRelease",
321319 {
322320 "class" : "Dist::Zilla::Plugin::Git::Commit",
323321 "name" : "@Apocalyptic/Git::Commit",
324 "version" : "1.103470"
322 "version" : "1.110500"
325323 },
326324 {
327325 "class" : "Dist::Zilla::Plugin::Git::Tag",
328326 "name" : "@Apocalyptic/Git::Tag",
329 "version" : "1.103470"
327 "version" : "1.110500"
330328 },
331329 {
332330 "class" : "Dist::Zilla::Plugin::Git::Push",
333331 "name" : "@Apocalyptic/Git::Push",
334 "version" : "1.103470"
332 "version" : "1.110500"
335333 },
336334 {
337335 "class" : "Dist::Zilla::Plugin::FinderCode",
2727 provides:
2828 POE::Component::SSLify:
2929 file: lib/POE/Component/SSLify.pm
30 version: 1.002
30 version: 1.003
3131 POE::Component::SSLify::ClientHandle:
3232 file: lib/POE/Component/SSLify/ClientHandle.pm
33 version: 1.002
33 version: 1.003
3434 POE::Component::SSLify::ServerHandle:
3535 file: lib/POE/Component/SSLify/ServerHandle.pm
36 version: 1.002
36 version: 1.003
3737 requires:
3838 Exporter: 0
3939 IO::Handle: 1.28
40 Net::SSLeay: 0
40 Net::SSLeay: 1.36
4141 Symbol: 0
4242 perl: 5.006
43 vars: 0
4443 resources:
4544 bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-SSLify
4645 homepage: http://search.cpan.org/dist/POE-Component-SSLify/
4746 license: http://dev.perl.org/licenses/
4847 repository: git://github.com/apocalypse/perl-poe-sslify.git
49 version: 1.002
48 version: 1.003
5049 x_BuiltWith:
5150 modules:
5251 Exporter: 5.63
6261 Symbol: 1.06
6362 Test::More: 0.96
6463 perl: 'NA(skipped: perl)'
65 vars: 1.01
6664 perl:
6765 original: v5.10.0
6866 qv: 1
7775 -
7876 class: Dist::Zilla::Plugin::Git::NextVersion
7977 name: '@Apocalyptic/Git::NextVersion'
80 version: 1.103470
78 version: 1.110500
8179 -
8280 class: Dist::Zilla::Plugin::GatherDir
8381 name: '@Apocalyptic/GatherDir'
223221 -
224222 class: Dist::Zilla::Plugin::Git::Check
225223 name: '@Apocalyptic/Git::Check'
226 version: 1.103470
224 version: 1.110500
227225 -
228226 class: Dist::Zilla::Plugin::ConfirmRelease
229227 name: '@Apocalyptic/ConfirmRelease'
239237 -
240238 class: Dist::Zilla::Plugin::Git::Commit
241239 name: '@Apocalyptic/Git::Commit'
242 version: 1.103470
240 version: 1.110500
243241 -
244242 class: Dist::Zilla::Plugin::Git::Tag
245243 name: '@Apocalyptic/Git::Tag'
246 version: 1.103470
244 version: 1.110500
247245 -
248246 class: Dist::Zilla::Plugin::Git::Push
249247 name: '@Apocalyptic/Git::Push'
250 version: 1.103470
248 version: 1.110500
251249 -
252250 class: Dist::Zilla::Plugin::FinderCode
253251 name: ':InstallModules'
3030 'PREREQ_PM' => {
3131 'Exporter' => '0',
3232 'IO::Handle' => '1.28',
33 'Net::SSLeay' => '0',
34 'Symbol' => '0',
35 'vars' => '0'
33 'Net::SSLeay' => '1.36',
34 'Symbol' => '0'
3635 },
37 'VERSION' => '1.002',
36 'VERSION' => '1.003',
3837 'test' => {
3938 'TESTS' => 't/*.t'
4039 }
11 POE::Component::SSLify - Makes using SSL in the world of POE easy!
22
33 VERSION
4 This document describes v1.002 of POE::Component::SSLify - released February 19, 2011 as part of POE-Component-SSLify.
4 This document describes v1.003 of POE::Component::SSLify - released February 28, 2011 as part of POE-Component-SSLify.
55
66 SYNOPSIS
77 # CLIENT-side usage
188188 Socket methods doesn't work
189189 The new socket this module gives you actually is some tied socket magic,
190190 so you cannot do stuff like getpeername() or getsockname(). The only way
191 to do it is to use SSLify_GetSocket and then operate on the socket it
191 to do it is to use "SSLify_GetSocket" and then operate on the socket it
192192 returns.
193193
194194 Dying everywhere...
209209 if ( $@ ) {
210210 # Unable to SSLify the socket...
211211 }
212 }
213
214 $IGNORE_SSL_ERRORS
215 As of SSLify v1.003 you can override this variable to temporarily ignore
216 some SSL errors. This is useful if you are doing crazy things with the
217 underlying Net::SSLeay stuff and don't want to die. However, it won't
218 ignore all errors as some is still considered fatal. Here's an example:
219
220 {
221 local $POE::Component::SSLify::IGNORE_SSL_ERRORS=1;
222 my $ctx = SSLify_CreateContext(...);
223 #Some more stuff
212224 }
213225
214226 OpenSSL functions
224236 that you're on a broken system. However, if you have the updated OpenSSL
225237 library that fixes this you can use it.
226238
227 In-Situ sslification
239 In-Situ sslification
228240 You can have a normal plaintext socket, and convert it to SSL anytime.
229241 Just keep in mind that the client and the server must agree to sslify at
230242 the same time, or they will be waiting on each other forever! See
231243 "t/3_insitu.t" for an example of how this works.
244
245 MSWin32 is not supported
246 This module doesn't work on MSWin32 platforms at all ( XP, Vista, 7, etc
247 ) because of some weird underlying fd issues. Since I'm not a windows
248 developer, I'm unable to fix this. However, it seems like Cygwin on
249 MSWin32 works just fine! Please help me fix this if you can, thanks!
232250
233251 EXPORT
234252 Stuffs all of the above functions in @EXPORT_OK so you have to request them directly
1313 -----BEGIN PGP SIGNED MESSAGE-----
1414 Hash: SHA1
1515
16 SHA1 824ac753cab91f2771cc02d2ef2ea3adcb553b3d Build.PL
17 SHA1 077d1b83cbdd3c5868246267d529f6ba86c9f5ae Changes
18 SHA1 bccfcc0e06e54b64690760210bffb659fc37d8a3 CommitLog
16 SHA1 f7303c3c5c4c01b8a3978878bb9694def4f21c85 Build.PL
17 SHA1 8c6118bc38d4a238e2bcecae98dd9aae02f8e084 Changes
18 SHA1 9579320245a7d68298b8024574c2c4f7f56dca08 CommitLog
1919 SHA1 e3edc44697d1770c65fec99f6ebdb6ea55fb3050 INSTALL
2020 SHA1 263360e99a0de4d587fedefe1a919dcf61af1d10 LICENSE
2121 SHA1 9b47f2f0b927dcb7cab2cc1f7daa62c5b50c55f8 MANIFEST
2222 SHA1 9dfc07c5655b958e800189837f3ddd37ca050bfe MANIFEST.SKIP
23 SHA1 46a26e693e358bfaae14207085afe55ba6eaf361 META.json
24 SHA1 c365eb8b83298415d1943bdab6d34d73857572d2 META.yml
25 SHA1 b6349b4bc00f32576a8824dc472b2ccc2090d121 Makefile.PL
26 SHA1 f35f0e1a391125f6e2d8db296430007ab257a6dc README
23 SHA1 48c9ad465a56b101fa1ac5c85999f30d1331887f META.json
24 SHA1 65aafd261f00a99d6b29708e37d61f61669672b6 META.yml
25 SHA1 29dba82edeb60493a1160a55ca1e884384e85031 Makefile.PL
26 SHA1 e9990bb66d60541b446cdb31e1aaec34de041314 README
2727 SHA1 41a5da1356107d097f6bbf72c62ee4da83e4119f dist.ini
2828 SHA1 96decb1c51052f9b024b6d069e428b4ccc19e909 examples/client.pl
2929 SHA1 d8f9b44df461cdcf6cbd7cffd79a9d49aade3947 examples/server.pl
3030 SHA1 c4a936c75d1d566e936dfb1776c9a01ea244c618 examples/serverclient.pl
31 SHA1 443d26c5a8beaaa9645707f05103bc05143a1531 lib/POE/Component/SSLify.pm
32 SHA1 b8e2f2b009899b565d7e654318620a69c14c52e0 lib/POE/Component/SSLify/ClientHandle.pm
33 SHA1 963fb5f3d99a99218836cac8c246735ef4ef66b0 lib/POE/Component/SSLify/ServerHandle.pm
31 SHA1 c078b1a678963b8b598da16e962710dff5744cc6 lib/POE/Component/SSLify.pm
32 SHA1 d9b21917a7729440324ba06a73ae033b3e98cf08 lib/POE/Component/SSLify/ClientHandle.pm
33 SHA1 3b6e6a9a9be570576af4b4317410bb4c1276407f lib/POE/Component/SSLify/ServerHandle.pm
3434 SHA1 59afa28f138a14b956443f915d60a891d5b306b8 mylib/example.crt
3535 SHA1 f2ba02d28cfb207e0a86be7cb4f3c570f257bf93 mylib/example.key
3636 SHA1 fd48b12e3df15fb55695e7d1b4ee95dc3c0cd766 t/00-compile.t
37 SHA1 17448d647ba0e9c5c6785b7f8d7757c3e19e1e47 t/000-report-versions-tiny.t
37 SHA1 82a0e48ffb58ff738831c80a41071c607012f483 t/000-report-versions-tiny.t
3838 SHA1 a0fb19347ec360acca7bb08e1b2e437179ef3cfa t/1_simple.t
3939 SHA1 c625a70ac63ea5d6a0fabd07130f1d3a905b1933 t/2_renegotiate.t
4040 SHA1 034a72d7403a58a756c8cbd2b1ce15afd9acf333 t/3_insitu.t
4141 -----BEGIN PGP SIGNATURE-----
4242 Version: GnuPG v1.4.9 (GNU/Linux)
4343
44 iEYEARECAAYFAk1gl10ACgkQGfr7vsGKgxwytACeNcYDu9CjrhwX+PHHvxsh90tB
45 xlMAn3NNRBe0mWb5DqISPlLucrQBl9+D
46 =Xtye
44 iEYEARECAAYFAk1rxMAACgkQGfr7vsGKgxyM4gCgnEeAD1ZuBBv0wbhPsQ1CZW9f
45 FAUAn2EkEydhhQOwiKB4qH8o4FNv6OJR
46 =aEEu
4747 -----END PGP SIGNATURE-----
88 use strict; use warnings;
99 package POE::Component::SSLify::ClientHandle;
1010 BEGIN {
11 $POE::Component::SSLify::ClientHandle::VERSION = '1.002';
11 $POE::Component::SSLify::ClientHandle::VERSION = '1.003';
1212 }
1313 BEGIN {
1414 $POE::Component::SSLify::ClientHandle::AUTHORITY = 'cpan:APOCAL';
1717 # ABSTRACT: Client-side handle for SSLify
1818
1919 # Import the SSL death routines
20 use Net::SSLeay qw( die_now die_if_ssl_error );
20 use Net::SSLeay 1.36 qw( die_now die_if_ssl_error );
2121
2222 # We inherit from ServerHandle
23 use vars qw( @ISA );
2423 require POE::Component::SSLify::ServerHandle;
25 @ISA = qw( POE::Component::SSLify::ServerHandle );
24 our @ISA = qw( POE::Component::SSLify::ServerHandle );
2625
2726 # Override TIEHANDLE because we create a CTX
2827 sub TIEHANDLE {
6867
6968 =head1 VERSION
7069
71 This document describes v1.002 of POE::Component::SSLify::ClientHandle - released February 19, 2011 as part of POE-Component-SSLify.
70 This document describes v1.003 of POE::Component::SSLify::ClientHandle - released February 28, 2011 as part of POE-Component-SSLify.
7271
7372 =head1 DESCRIPTION
7473
88 use strict; use warnings;
99 package POE::Component::SSLify::ServerHandle;
1010 BEGIN {
11 $POE::Component::SSLify::ServerHandle::VERSION = '1.002';
11 $POE::Component::SSLify::ServerHandle::VERSION = '1.003';
1212 }
1313 BEGIN {
1414 $POE::Component::SSLify::ServerHandle::AUTHORITY = 'cpan:APOCAL';
1717 # ABSTRACT: Server-side handle for SSLify
1818
1919 # Import the SSL death routines
20 use Net::SSLeay qw( die_now die_if_ssl_error );
20 use Net::SSLeay 1.36 qw( die_now die_if_ssl_error );
2121
2222 # Ties the socket
2323 sub TIEHANDLE {
180180
181181 =head1 VERSION
182182
183 This document describes v1.002 of POE::Component::SSLify::ServerHandle - released February 19, 2011 as part of POE-Component-SSLify.
183 This document describes v1.003 of POE::Component::SSLify::ServerHandle - released February 28, 2011 as part of POE-Component-SSLify.
184184
185185 =head1 DESCRIPTION
186186
88 use strict; use warnings;
99 package POE::Component::SSLify;
1010 BEGIN {
11 $POE::Component::SSLify::VERSION = '1.002';
11 $POE::Component::SSLify::VERSION = '1.003';
1212 }
1313 BEGIN {
1414 $POE::Component::SSLify::AUTHORITY = 'cpan:APOCAL';
4343
4444 # Do the exporting magic...
4545 require Exporter;
46 use vars qw( @ISA @EXPORT_OK );
47 @ISA = qw( Exporter );
48 @EXPORT_OK = qw( Client_SSLify Server_SSLify SSLify_Options SSLify_GetCTX SSLify_GetCipher SSLify_GetSocket SSLify_GetSSL SSLify_ContextCreate );
46 our @ISA = qw( Exporter );
47 our @EXPORT_OK = qw( Client_SSLify Server_SSLify SSLify_Options SSLify_GetCTX SSLify_GetCipher SSLify_GetSocket SSLify_GetSSL SSLify_ContextCreate );
4948
5049 # Bring in some socket-related stuff
5150 use Symbol qw( gensym );
5655
5756 # The server-side CTX stuff
5857 my $ctx = undef;
58
59 # global so users of this module can override it locally
60 our $IGNORE_SSL_ERRORS = 0;
5961
6062
6163 sub Client_SSLify {
171173
172174 # do we need to set options?
173175 if ( defined $options ) {
174 Net::SSLeay::CTX_set_options( $context, $options ) and die_if_ssl_error( 'ssl ctx set options' );
176 Net::SSLeay::CTX_set_options( $context, $options );
177 die_if_ssl_error( 'ssl ctx set options' ) if ! $IGNORE_SSL_ERRORS;
175178 }
176179
177180 # do we need to set key/etc?
178181 if ( defined $key ) {
179182 # Following will ask password unless private key is not encrypted
180183 Net::SSLeay::CTX_use_RSAPrivateKey_file( $context, $key, &Net::SSLeay::FILETYPE_PEM );
181 die_if_ssl_error( 'private key' );
184 die_if_ssl_error( 'private key' ) if ! $IGNORE_SSL_ERRORS;
182185 }
183186
184187 # Set the cert file
185188 if ( defined $cert ) {
186189 Net::SSLeay::CTX_use_certificate_file( $context, $cert, &Net::SSLeay::FILETYPE_PEM );
187 die_if_ssl_error( 'certificate' );
190 die_if_ssl_error( 'certificate' ) if ! $IGNORE_SSL_ERRORS;
188191 }
189192
190193 # All done!
231234
232235 =head1 VERSION
233236
234 This document describes v1.002 of POE::Component::SSLify - released February 19, 2011 as part of POE-Component-SSLify.
237 This document describes v1.003 of POE::Component::SSLify - released February 28, 2011 as part of POE-Component-SSLify.
235238
236239 =head1 SYNOPSIS
237240
430433 =head2 Socket methods doesn't work
431434
432435 The new socket this module gives you actually is some tied socket magic, so you cannot do stuff like
433 getpeername() or getsockname(). The only way to do it is to use SSLify_GetSocket and then operate on
436 getpeername() or getsockname(). The only way to do it is to use L</SSLify_GetSocket> and then operate on
434437 the socket it returns.
435438
436439 =head2 Dying everywhere...
453456 }
454457 }
455458
459 =head3 $IGNORE_SSL_ERRORS
460
461 As of SSLify v1.003 you can override this variable to temporarily ignore some SSL errors. This is useful if you are doing crazy things
462 with the underlying Net::SSLeay stuff and don't want to die. However, it won't ignore all errors as some is still considered fatal.
463 Here's an example:
464
465 {
466 local $POE::Component::SSLify::IGNORE_SSL_ERRORS=1;
467 my $ctx = SSLify_CreateContext(...);
468 #Some more stuff
469 }
470
456471 =head2 OpenSSL functions
457472
458473 Theoretically you can do anything that Net::SSLeay exports from the OpenSSL libs on the socket. However, I have not tested every
464479 L<http://security.freebsd.org/advisories/FreeBSD-SA-09:15.ssl.asc> which explains it in detail. The test will skip this function
465480 if it detects that you're on a broken system. However, if you have the updated OpenSSL library that fixes this you can use it.
466481
467 =head3 In-Situ sslification
482 =head2 In-Situ sslification
468483
469484 You can have a normal plaintext socket, and convert it to SSL anytime. Just keep in mind that the client and the server must agree to sslify
470485 at the same time, or they will be waiting on each other forever! See C<t/3_insitu.t> for an example of how this works.
486
487 =head2 MSWin32 is not supported
488
489 This module doesn't work on MSWin32 platforms at all ( XP, Vista, 7, etc ) because of some weird underlying fd issues. Since I'm not a windows
490 developer, I'm unable to fix this. However, it seems like Cygwin on MSWin32 works just fine! Please help me fix this if you can, thanks!
471491
472492 =head1 EXPORT
473493
5252 eval { $v .= pmver('File::Temp','any version') };
5353 eval { $v .= pmver('IO::Handle','1.28') };
5454 eval { $v .= pmver('Module::Build','0.3601') };
55 eval { $v .= pmver('Net::SSLeay','any version') };
55 eval { $v .= pmver('Net::SSLeay','1.36') };
5656 eval { $v .= pmver('POE','1.267') };
5757 eval { $v .= pmver('POE::Component::Client::TCP','any version') };
5858 eval { $v .= pmver('POE::Component::Server::TCP','any version') };
5959 eval { $v .= pmver('Socket','any version') };
6060 eval { $v .= pmver('Symbol','any version') };
6161 eval { $v .= pmver('Test::More','0.88') };
62 eval { $v .= pmver('vars','any version') };
6362
6463
6564