Codebase list libpoe-component-sslify-perl / e9ebaf1
Imported Upstream version 1.012 gregor herrmann 8 years ago
51 changed file(s) with 4713 addition(s) and 2824 deletion(s). Raw diff Collapse all Expand all
0
1 # CPAN Covenant for POE-Component-SSLify
2
3 I, Apocalypse <APOCAL@cpan.org>, hereby give modules@perl.org permission to grant co-maintainership
4 to POE-Component-SSLify, if all the following conditions are met:
5
6 (1) I haven't released the module for a year or more
7 (2) There are outstanding issues in the module's public bug tracker
8 (3) Email to my CPAN email address hasn't been answered after a month
9 (4) The requester wants to make worthwhile changes that will benefit CPAN
10
11 In the event of my death, then the time-limits in (1) and (3) do not apply.
12
0
0 #
1 # This file is part of POE-Component-SSLify
2 #
3 # This software is copyright (c) 2014 by Apocalypse.
4 #
5 # This is free software; you can redistribute it and/or modify it under
6 # the same terms as the Perl 5 programming language system itself.
7 #
8 use strict; use warnings;
9 # This Build.PL for POE-Component-SSLify was generated by Dist::Zilla::Plugin::ModuleBuildTiny 0.008.
110 use strict;
211 use warnings;
312
4 use Module::Build 0.3601;
5
6
7 my %module_build_args = (
8 'build_requires' => {
9 'File::Find' => '0',
10 'File::Temp' => '0',
11 'Module::Build' => '0.3601',
12 'POE' => '1.267',
13 'POE::Component::Client::TCP' => '0',
14 'POE::Component::Server::TCP' => '0',
15 'Socket' => '0',
16 'Test::More' => '0.88'
17 },
18 'configure_requires' => {
19 'Module::Build' => '0.3601'
20 },
21 'dist_abstract' => 'Makes using SSL in the world of POE easy!',
22 'dist_author' => [
23 'Apocalypse <APOCAL@cpan.org>'
24 ],
25 'dist_name' => 'POE-Component-SSLify',
26 'dist_version' => '1.008',
27 'license' => 'perl',
28 'module_name' => 'POE::Component::SSLify',
29 'recommends' => {},
30 'recursive_test_files' => 1,
31 'requires' => {
32 'Exporter' => '0',
33 'IO::Handle' => '1.28',
34 'Net::SSLeay' => '1.36',
35 'POE' => '0',
36 'Scalar::Util' => '0',
37 'Symbol' => '0',
38 'Task::Weaken' => '1.03',
39 'parent' => '0',
40 'perl' => '5.006'
41 },
42 'script_files' => []
43 );
44
45
46 my $build = Module::Build->new(%module_build_args);
47
48 $build->create_build_script;
13 use 5.006;
14 use Module::Build::Tiny 0.039;
15 Build_PL();
+156
-141
Changes less more
0 Revision history for Perl extension POE::Component::SSLify.
0 Revision history for POE-Component-SSLify
11
2 1.008
3 Released: 2011-05-04 21:55:27 UTC
2 1.012 2014-11-14T20:19:52Z UTC
3 - Reduce memory usage and speedup writing large strings by avoiding substr
4 magic
45
5 Bazerka@irc noticed that POE wasn't even listed as a runtime prereq, d0h!
6 [STATISTICS]
7 - code churn: 2 files changed, 6 insertions(+), 3 deletions(-)
68
7 1.007
8 Released: 2011-05-04 21:36:32 UTC
9 1.011 2014-11-14T03:06:48Z UTC
10 - Tweak the testsuite thanks to CPANTesters!
911
10 Revert the ENGINE load logic added in 1.004 because it was causing coredumps on netbsd ( thanks BINGOS! )
11 Add the constant LOAD_SSL_ENGINES sub if you need to load the ssl engines
12 Tweak the renegotiate tests to be more tolerant of failures, thanks RCAPUTO - RT#66741
12 [STATISTICS]
13 - code churn: 11 files changed, 37 insertions(+), 35 deletions(-)
1314
14 1.006
15 Released: 2011-04-22 00:21:51 UTC
15 1.010 2014-11-12T06:13:41Z UTC
16 - add informational test that prints out ssleay version
17 - clamp the writes to 16K internally to get around write errors reported
18 by RT#95071 and RT#58243, thanks!
1619
17 Fix a heinous bug where openssl will randomly+reliably close a connection ( thanks MIRE )
18 Tweak the hook tests so they test the case where no data is sent over the connection
19 Tweak the connfail tests so they work better
20 [STATISTICS]
21 - code churn: 7 files changed, 591 insertions(+), 5 deletions(-)
2022
21 1.005
22 Released: 2011-03-10 07:55:30 UTC
23 1.009 2014-11-12T00:41:25Z UTC
24 - Updates to the auto-generated files
25 - Tweaked the testsuite to use done_testing() for sanity, RT#66741 (thanks
26 RCAPUTO!)
27 - Use Test::FailWarnings in the testsuite in place of Test::NoWarnings
28 (DAGOLDEN++)
29 - Add t/simple_large.t to try and track down RT#58243 (thanks Johan!)
30 - Added a boatload of tests to try and track down RT#95071 (thanks Joe!)
2331
24 Fix the connfail tests due to an incorrect assumption regards socket close value, thanks CPANTesters!
32 [STATISTICS]
33 - code churn: 27 files changed, 2160 insertions(+), 1503 deletions(-)
2534
26 1.004
27 Released: 2011-03-08 23:39:03 UTC
35 1.008 2011-05-04T21:55:27Z UTC
36 - Bazerka@irc noticed that POE wasn't even listed as a runtime prereq,
37 d0h!
2838
29 We now load certificate files via CTX_use_certificate_chain_file(), thanks Zephaniah E. Loss-Cutler-Hull <warp-spam_perl@aehallh.com>
30 OpenSSL docs suggest it - http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html#NOTES
31 PLEASE yell at me if you need the old functionality - the docs suggest this is the "better" way to do it...
32 Add the ability to pass a subref to call on connection/negotiation success, thanks Zephaniah E. Loss-Cutler-Hull <warp-spam_perl@aehallh.com>
33 NOTE: This will not work if you do renegotiation or any other zany SSL stuff!
34 Add the SSLify_GetStatus function to get the status of the connection
35 After staring at the Net::SSLeay/OpenSSL docs for a while I realized we were missing support for sslv23 version, added!
36 After some investigation, we now load all default ENGINEs for OpenSSL on startup, as it might provide a performance boost
39 1.007 2011-05-04T21:36:32Z UTC
40 - Revert the ENGINE load logic added in 1.004 because it was causing
41 coredumps on netbsd ( thanks BINGOS! )
42 - Add the constant LOAD_SSL_ENGINES sub if you need to load the ssl
43 engines
44 - Tweak the renegotiate tests to be more tolerant of failures, thanks
45 RCAPUTO - RT#66741
3746
38 1.003
39 Released: 2011-02-28 15:52:24 UTC
47 1.006 2011-04-22T00:21:51Z UTC
48 - Fix a heinous bug where openssl will randomly+reliably close a
49 connection ( thanks MIRE )
50 - Tweak the hook tests so they test the case where no data is sent over
51 the connection
52 - Tweak the connfail tests so they work better
4053
41 Add $IGNORE_SSL_ERRORS to ignore certain SSL errors, thanks MNUNBERG - RT#66130
42 Remove prereq on vars.pm as it's obsolete
54 1.005 2011-03-10T07:55:30Z UTC
55 - Fix the connfail tests due to an incorrect assumption regards socket
56 close value, thanks CPANTesters!
4357
44 1.002
45 Released: 2011-02-20 04:23:48 UTC
58 1.004 2011-03-08T23:39:03Z UTC
59 - We now load certificate files via CTX_use_certificate_chain_file(),
60 thanks Zephaniah E. Loss-Cutler-Hull <warp-spam_perl@aehallh.com>
61 OpenSSL docs suggest it -
62 http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html#NOTES
63 PLEASE yell at me if you need the old functionality - the docs suggest
64 this is the "better" way to do it...
65 - Add the ability to pass a subref to call on connection/negotiation
66 success, thanks Zephaniah E. Loss-Cutler-Hull
67 <warp-spam_perl@aehallh.com> NOTE: This will not work if you do
68 renegotiation or any other zany SSL stuff!
69 - Add the SSLify_GetStatus function to get the status of the connection
70 - After staring at the Net::SSLeay/OpenSSL docs for a while I realized we
71 were missing support for sslv23 version, added!
72 - After some investigation, we now load all default ENGINEs for OpenSSL on
73 startup, as it might provide a performance boost
4674
47 Add SSLify_GetSSL to get the Net::SSLeay object, thanks MNUNBERG!
75 1.003 2011-02-28T15:52:24Z UTC
76 - Add $IGNORE_SSL_ERRORS to ignore certain SSL errors, thanks MNUNBERG -
77 RT#66130
78 - Remove prereq on vars.pm as it's obsolete
4879
49 1.001
50 Released: 2011-02-13 18:11:07 UTC
80 1.002 2011-02-20T04:23:48Z UTC
81 - Add SSLify_GetSSL to get the Net::SSLeay object, thanks MNUNBERG!
5182
52 Fixed the Net::SSLeay import code, thanks CPANTesters!
83 1.001 2011-02-13T18:11:07Z UTC
84 - Fixed the Net::SSLeay import code, thanks CPANTesters!
5385
54 1.000
55 Released: 2011-02-13 00:06:14 UTC
86 1.000 2011-02-13T00:06:14Z UTC
87 - Converted to Dist::Zilla for the release process!
88 - Add a test for in-situ sslification, thanks MNUNBERG!
89 - Add prereq for IO::Handle 1.28 to get sane $socket->blocking( 0 )
90 behavior on MSWin32
91 - Remove crufty old code for nonblocking and use $socket->blocking()
92 instead
5693
57 Converted to Dist::Zilla for the release process!
58 Add a test for in-situ sslification, thanks MNUNBERG!
59 Add prereq for IO::Handle 1.28 to get sane $socket->blocking( 0 ) behavior on MSWin32
60 Remove crufty old code for nonblocking and use $socket->blocking() instead
94 0.20 0000-00-00T00:00:00Z UTC
95 - Split up the simple.t test into 2 tests for clarity, and added more diag
96 messages for renegotiate, thanks HMBRAND!
6197
62 0.20
98 0.19 0000-00-00T00:00:00Z UTC
99 - Fixed a warning generated by POE::Component::Client::TCP in t/simple.t,
100 thanks HMBRAND!
63101
64 Split up the simple.t test into 2 tests for clarity, and added more diag messages for renegotiate, thanks HMBRAND!
102 0.18 0000-00-00T00:00:00Z UTC
103 - Bumped POE dep to at least 1.267 for t/simple.t - thanks CPANTesters!
104 - Minor typo fixes in POD/Build.PL
65105
66 0.19
106 0.17 0000-00-00T00:00:00Z UTC
107 - Fixed the t/simple.t test to PASS on FreeBSD because
108 Net::SSLeay::renegotiate was buggy on it, thanks CPANTesters!
109 - Added note about OpenSSL functions in the POD.
67110
68 Fixed a warning generated by POE::Component::Client::TCP in t/simple.t, thanks HMBRAND!
111 0.16 0000-00-00T00:00:00Z UTC
112 - Updated the nonblocking code to be production-ready, thanks ASCENT!
113 - Removed the NONBLOCKING() sub, this module is now always nonblocking.
114 - Added more tests, thanks ASCENT!
115 - Added "mylib/example.crt" and "mylib/example.key" for testing, thanks
116 ASCENT!
117 - Misc kwalitee and POD fixes.
118 - Bumped Net::SSLeay prereq to 1.36 so we have the latest SSL stuff to
119 ensure sanity :)
69120
70 0.18
121 0.15 0000-00-00T00:00:00Z UTC
122 - Added "examples/serverclient.pl" to track down same-process sslification
123 problems, thanks LotR!
124 - Applied patch from BinGOs to support passing custom $ctx for
125 Server_SSLify, thanks! RT#43018
126 - Switched over to Test::Apocalypse for easy author tests
127 - Added experimental NONBLOCKING code, thanks ASCENT for the motivation!
71128
72 Bumped POE dep to at least 1.267 for t/simple.t - thanks CPANTesters!
73 Minor typo fixes in POD/Build.PL
129 0.14 0000-00-00T00:00:00Z UTC
130 - removed Test::* modules from dependency list, thanks BINGOS - RT #36725
131 - dos2unix fixes - thanks RT #36704
132 - added Build.PL
74133
75 0.17
134 0.13 0000-00-00T00:00:00Z UTC
135 - POD typo errors in SSLify_ContextCreate - thanks ASCENT!
76136
77 Fixed the t/simple.t test to PASS on FreeBSD because Net::SSLeay::renegotiate was buggy on it, thanks CPANTesters!
78 Added note about OpenSSL functions in the POD.
137 0.12 0000-00-00T00:00:00Z UTC
138 - Kwalitee-related fixes
79139
80 0.16
140 0.11 0000-00-00T00:00:00Z UTC
141 - allowed setting of client-side context ( $ctx ) object - thanks RT
142 #34442
143 - squashed typo in pod - thanks ASCENT!
144 - changed version check code to regexp for compatibility with SSLeay
145 v1.33_01 - thanks Mark!
146 - added SSLify_ContextCreate helper function
147 - backported Net::SSLeay's removal of %Filenum_Objects hash
81148
82 Updated the nonblocking code to be production-ready, thanks ASCENT!
83 Removed the NONBLOCKING() sub, this module is now always nonblocking.
84 Added more tests, thanks ASCENT!
85 Added "mylib/example.crt" and "mylib/example.key" for testing, thanks ASCENT!
86 Misc kwalitee and POD fixes.
87 Bumped Net::SSLeay prereq to 1.36 so we have the latest SSL stuff to ensure sanity :)
149 0.10 0000-00-00T00:00:00Z UTC
150 - More tweaks of POD - finally close RT #31238
151 - Added SSL version support - thanks RT #31492
152 - Added SSL CTX option support as a side effect
153 - Added client.pl example with ReadLine support
88154
89 0.15
155 0.09 0000-00-00T00:00:00Z UTC
156 - Minor tweak of POD to enable better distro building - thanks RT #31238
90157
91 Added "examples/serverclient.pl" to track down same-process sslification problems, thanks LotR!
158 0.08 0000-00-00T00:00:00Z UTC
159 - Added support for BINMODE - thanks RT #27117
92160
93 Applied patch from BinGOs to support passing custom $ctx for Server_SSLify, thanks! RT#43018
161 0.07 0000-00-00T00:00:00Z UTC
162 - Fixed undefined $info - thanks RT #22372
94163
95 Switched over to Test::Apocalypse for easy author tests
164 0.06 0000-00-00T00:00:00Z UTC
165 - Kwalitee-related fixes
96166
97 Added experimental NONBLOCKING code, thanks ASCENT for the motivation!
167 0.05 0000-00-00T00:00:00Z UTC
168 - Finally use a Changes file - thanks RT #18981
169 - Documentation tweaks
170 - Upgraded Net::SSLeay requirement to 1.30 to help Win32 problems
98171
99 0.14
172 0.04 0000-00-00T00:00:00Z UTC
173 - Added new functions to extract data from the SSL socket -> GetCipher and
174 GetSocket
175 - In the case somebody knows Net::SSLeay more than me, added GetCTX to
176 return the server-side CTX object
177 - Removed the dependency on Net::SSLeay::Handle
100178
101 removed Test::* modules from dependency list, thanks BINGOS - RT #36725
179 0.03 0000-00-00T00:00:00Z UTC
180 - First stab at the server-side code, help me test it out!
181 - Refactored SSLify() into client/server side, so update your program
182 accordingly!
102183
103 dos2unix fixes - thanks RT #36704
184 0.02 0000-00-00T00:00:00Z UTC
185 - Made sure the IO::Handle way was used only on MSWin32
186 - SSLify::ServerHandle
187 - Removed _CIPHER and moved it to the main SSLify.pm code
188 - Oops, forgot to override _get_self and _get_ssl
189 - Fixed a nasty leak issue
104190
105 added Build.PL
191 0.01 0000-00-00T00:00:00Z UTC
192 - Initial release
106193
107 0.13
108
109 POD typo errors in SSLify_ContextCreate - thanks ASCENT!
110
111 0.12
112
113 Kwalitee-related fixes
114
115 0.11
116
117 allowed setting of client-side context ( $ctx ) object - thanks RT #34442
118
119 squashed typo in pod - thanks ASCENT!
120
121 changed version check code to regexp for compatibility with SSLeay v1.33_01 - thanks Mark!
122
123 added SSLify_ContextCreate helper function
124
125 backported Net::SSLeay's removal of %Filenum_Objects hash
126
127 0.10
128
129 More tweaks of POD - finally close RT #31238
130 Added SSL version support - thanks RT #31492
131 Added SSL CTX option support as a side effect
132 Added client.pl example with ReadLine support
133
134 0.09
135
136 Minor tweak of POD to enable better distro building - thanks RT #31238
137
138 0.08
139
140 Added support for BINMODE - thanks RT #27117
141
142 0.07
143
144 Fixed undefined $info - thanks RT #22372
145
146 0.06
147
148 Kwalitee-related fixes
149
150 0.05
151
152 Finally use a Changes file - thanks RT #18981
153 Documentation tweaks
154 Upgraded Net::SSLeay requirement to 1.30 to help Win32 problems
155
156 0.04
157
158 Added new functions to extract data from the SSL socket -> GetCipher and GetSocket
159 In the case somebody knows Net::SSLeay more than me, added GetCTX to return the server-side CTX object
160 Removed the dependency on Net::SSLeay::Handle
161
162 0.03
163
164 First stab at the server-side code, help me test it out!
165 Refactored SSLify() into client/server side, so update your program accordingly!
166
167 0.02
168
169 Made sure the IO::Handle way was used only on MSWin32
170
171 * SSLify::ServerHandle
172 Removed _CIPHER and moved it to the main SSLify.pm code
173 Oops, forgot to override _get_self and _get_ssl
174 Fixed a nasty leak issue
175
176 0.01
177
178 Initial release
0 ==============================
1 9999-99-99 99:99:99 +0000 HEAD
2 ==============================
0 ==================================================
1 Changes from 2013-11-14 00:00:00 +0000 to present.
2 ==================================================
33
4 commit 4fa0a44b7f0a9b37ef5fcbcb07ad6e45dd50b265
5 Author: Apocalypse <perl@0ne.us>
6 Date: Wed May 4 14:53:14 2011 -0700
7
8 actually require POE as a runtime prereq, thanks Bazerka@irc
4 ------------------------------------------
5 version 1.012 at 2014-11-14 20:19:55 +0000
6 ------------------------------------------
97
10 =======================================
11 2011-05-04 14:37:11 -0700 release-1.007
12 =======================================
8 Change: 57b6383e061d573e12fe9cc90950cdbc37dcd25f
9 Author: Apocalypse <APOCAL@cpan.org>
10 Date : 2014-11-14 12:18:49 +0000
1311
14 commit 5ada288a8ab2b24c6472e5a8fb3f43958fa22445
15 Author: Apocalypse <perl@0ne.us>
16 Date: Wed May 4 14:37:11 2011 -0700
17
18 New CPAN release of POE-Component-SSLify - v1.007
12 remove magic from substr and reduce copying of strings
1913
20 Released: 2011-05-04 21:36:32 UTC
14 ------------------------------------------
15 version 1.011 at 2014-11-14 03:08:48 +0000
16 ------------------------------------------
2117
22 Revert the ENGINE load logic added in 1.004 because it was causing
23 coredumps on netbsd ( thanks BINGOS! )
18 Change: 65afe245446e0e64a7a7eb87154f9d039fc39272
19 Author: Apocalypse <APOCAL@cpan.org>
20 Date : 2014-11-13 19:08:48 +0000
2421
25 Add the constant LOAD_SSL_ENGINES sub if you need to load the ssl
26 engines
22 New CPAN release of POE-Component-SSLify - v1.011
2723
28 Tweak the renegotiate tests to be more tolerant of failures, thanks
29 RCAPUTO - RT#66741
24 - Tweak the testsuite thanks to CPANTesters!
3025
31 commit 958b153b6d09773230336793b1a3f2f2848a55dc
32 Author: Apocalypse <perl@0ne.us>
33 Date: Wed May 4 14:34:15 2011 -0700
34
35 rename some POD for pod::coverage tests
26 [STATISTICS]
3627
37 commit 125745d00aa051e13a18ac207a618c50913bbd57
38 Author: Apocalypse <perl@0ne.us>
39 Date: Wed May 4 14:21:22 2011 -0700
40
41 rewrite the renegotiate tests in hope of fixing RT#66741
28 - code churn: 11 files changed, 37 insertions(+), 35 deletions(-)
4229
43 commit 393337624aef50602f4f2e9ff4ec412e1cbe7d76
44 Author: Apocalypse <perl@0ne.us>
45 Date: Wed May 4 14:02:59 2011 -0700
46
47 fix netbsd coredumps by not loading ENGINEs, reported by BINGOS
30 Change: 6795ac7e0577df360e1cd094113235d12eaae9d9
31 Author: Apocalypse <APOCAL@cpan.org>
32 Date : 2014-11-13 19:06:41 +0000
4833
49 =======================================
50 2011-04-21 17:22:30 -0700 release-1.006
51 =======================================
34 remove TODO from superbig tests
5235
53 commit 0096f51336380c31d99e87cf93a63ed650e60aff
54 Author: Apocalypse <perl@0ne.us>
55 Date: Thu Apr 21 17:22:30 2011 -0700
56
57 New CPAN release of POE-Component-SSLify - v1.006
36 Change: 82379d6f23f8bbb76a03ed26fd4bdbc2af288fd2
37 Author: Apocalypse <APOCAL@cpan.org>
38 Date : 2014-11-13 19:01:25 +0000
5839
59 Released: 2011-04-22 00:21:51 UTC
40 dont test blocking mode on MSWin32, thanks CPANTesters and DSOLIMANO
6041
61 Fix a heinous bug where openssl will randomly+reliably close a
62 connection ( thanks MIRE )
42 Change: 48c4ba77fed8089a608ecaf9ec8b7789a3e73c27
43 Author: Apocalypse <APOCAL@cpan.org>
44 Date : 2014-11-13 18:47:32 +0000
6345
64 Tweak the hook tests so they test the case where no data is sent over
65 the connection
46 switch to POE::Filter::Block to reduce issues from Filter::Line
6647
67 Tweak the connfail tests so they work better
48 Change: 9a89ec61f97b246088fb02508d1479295706bd22
49 Author: Apocalypse <APOCAL@cpan.org>
50 Date : 2014-11-13 16:30:19 +0000
6851
69 commit df65edee2621f55f347db2c70d779e44d93b87d2
70 Author: Apocalypse <perl@0ne.us>
71 Date: Thu Apr 21 17:16:15 2011 -0700
72
73 mire@irc is now MIRE, congrats
52 add pogomips concept from POE =]
7453
75 commit 853522b575570c997d3c8ff70c530cd45cde1e40
76 Author: Apocalypse <perl@0ne.us>
77 Date: Thu Apr 21 14:54:08 2011 -0700
78
79 tweak mires test a bit
54 ------------------------------------------
55 version 1.010 at 2014-11-12 06:19:01 +0000
56 ------------------------------------------
8057
81 commit e745765e01f9c07e0b195b2c49be40bea2e916f4
82 Author: Apocalypse <perl@0ne.us>
83 Date: Thu Apr 21 08:28:42 2011 -0700
84
85 start of work on mire's testcase
58 Change: dc234fe2f82b3982d475ee45fdc3534d1bfc178d
59 Author: Apocalypse <APOCAL@cpan.org>
60 Date : 2014-11-11 22:19:01 +0000
8661
87 commit 15e3d473b68e6e0ac36673bbc71b7125fd49ed2f
88 Author: Apocalypse <perl@0ne.us>
89 Date: Thu Apr 21 00:03:23 2011 -0700
90
91 add mire test to be worked into a proper AUTHOR test
62 New CPAN release of POE-Component-SSLify - v1.010
9263
93 commit ad5c8c95dce50c051d8c54ade4c90b45f49103c3
94 Author: Apocalypse <perl@0ne.us>
95 Date: Wed Apr 20 20:44:15 2011 -0700
96
97 update changelog for the fixes
64 - add informational test that prints out ssleay version
9865
99 commit ed9e2b33c10572df76e790ffad68d3d7ecb820f9
100 Author: Apocalypse <perl@0ne.us>
101 Date: Wed Apr 20 20:11:17 2011 -0700
102
103 fix random SSL failures, spotted by mire
66 - clamp the writes to 16K internally to get around write errors
67 reported
10468
105 commit 5a9b28e587a3dace6ed71bd93691215b47cbc348
106 Author: Apocalypse <perl@0ne.us>
107 Date: Wed Apr 20 20:09:00 2011 -0700
108
109 tweak the connfail tests and make the server test work
69 by RT#95071 and RT#58243, thanks!
11070
111 commit 806d4c4df5ca108c8cfacbb19babcfebc8b05cdc
112 Author: Apocalypse <perl@0ne.us>
113 Date: Wed Apr 20 20:08:18 2011 -0700
114
115 tweak the hook tests to cover the case where there is no data sent
116 over the wire
71 [STATISTICS]
11772
118 =======================================
119 2011-03-10 00:56:13 -0700 release-1.005
120 =======================================
73 - code churn: 7 files changed, 591 insertions(+), 5 deletions(-)
12174
122 commit bc1a271e1f6e597f42cf03723ef6525a21281bea
123 Author: Apocalypse <perl@0ne.us>
124 Date: Thu Mar 10 00:56:13 2011 -0700
125
126 New CPAN release of POE-Component-SSLify - v1.005
75 Change: f8043053bd401402979e7161d2fcc31f8184cb3b
76 Author: Apocalypse <APOCAL@cpan.org>
77 Date : 2014-11-11 22:13:38 +0000
12778
128 Released: 2011-03-10 07:55:30 UTC
79 satisfy perlcritic...
12980
130 Fix the connfail tests due to an incorrect assumption regards socket
131 close value, thanks CPANTesters!
81 Change: c0ce9919c362c501fbe2487b718e68e5a7e1f038
82 Author: Apocalypse <APOCAL@cpan.org>
83 Date : 2014-11-11 21:50:17 +0000
13284
133 commit d8b4c0e354acf683f17fd63186810226e101b54e
134 Author: Apocalypse <perl@0ne.us>
135 Date: Thu Mar 10 00:54:05 2011 -0700
136
137 fix an incorrect assumption in the connfail tests, thanks CPANTesters
85 add website link about same write issue
13886
139 =======================================
140 2011-03-08 16:43:43 -0700 release-1.004
141 =======================================
87 Change: 3d8fa3c965241a7bc6b9b229d56863823dab02f5
88 Author: Apocalypse <APOCAL@cpan.org>
89 Date : 2014-11-11 21:46:21 +0000
14290
143 commit 073ae0a4eb74e7c7bd24db3717653ee5764db6bb
144 Author: Apocalypse <perl@0ne.us>
145 Date: Tue Mar 8 16:43:43 2011 -0700
146
147 New CPAN release of POE-Component-SSLify - v1.004
91 tweak changes header
14892
149 Released: 2011-03-08 23:39:03 UTC
93 Change: 26ef9be50cd5069bfe938fc41da7630ef0d5a739
94 Author: Apocalypse <APOCAL@cpan.org>
95 Date : 2014-11-11 21:41:59 +0000
15096
151 We now load certificate files via CTX_use_certificate_chain_file(),
152 thanks Zephaniah E. Loss-Cutler-Hull <warp-spam_perl@aehallh.com>
97 clamp the writes
15398
154 OpenSSL docs suggest it -
155 http://www.openssl.org/docs/ssl/SSL_CTX_use_certificate.html#NOTES
99 Change: cae051e4f8c5c6368b9112a4fdc94f75b20ccf0d
100 Author: Apocalypse <APOCAL@cpan.org>
101 Date : 2014-11-11 21:41:07 +0000
156102
157 PLEASE yell at me if you need the old functionality - the docs
158 suggest this is the "better" way to do it...
103 activate superbig tests for automated
159104
160 Add the ability to pass a subref to call on connection/negotiation
161 success, thanks Zephaniah E. Loss-Cutler-Hull
162 <warp-spam_perl@aehallh.com>
105 Change: 68ffe2c85d5f250b02b14e16da8fc973dfb259aa
106 Author: Apocalypse <APOCAL@cpan.org>
107 Date : 2014-11-11 21:30:21 +0000
163108
164 NOTE: This will not work if you do renegotiation or any other zany
165 SSL stuff!
109 add ssleay info test
166110
167 Add the SSLify_GetStatus function to get the status of the connection
111 Change: 200d56da2705d8bb5dedc384a8f7694aba331053
112 Author: Apocalypse <APOCAL@cpan.org>
113 Date : 2014-11-11 16:52:04 +0000
168114
169 After staring at the Net::SSLeay/OpenSSL docs for a while I realized
170 we were missing support for sslv23 version, added!
115 fix damn tabs
171116
172 After some investigation, we now load all default ENGINEs for OpenSSL
173 on startup, as it might provide a performance boost
117 ------------------------------------------
118 version 1.009 at 2014-11-12 00:45:19 +0000
119 ------------------------------------------
174120
175 commit f9f664939980fdd646c3331815c7c9935e9ee248
176 Author: Apocalypse <perl@0ne.us>
177 Date: Tue Mar 8 16:29:27 2011 -0700
178
179 yet more POD tweaks
121 Change: 89e7cf553d93fe61a3c2eb9240f027b87d80954d
122 Author: Apocalypse <APOCAL@cpan.org>
123 Date : 2014-11-11 16:45:19 +0000
180124
181 commit 79116f5515997c0353659c5611d943f73e6a3d58
182 Author: Apocalypse <perl@0ne.us>
183 Date: Tue Mar 8 16:23:19 2011 -0700
184
185 add more POD about callback and make the status a boolean value
125 New CPAN release of POE-Component-SSLify - v1.009
186126
187 commit fb1c1a1c135a20fea4f749548d6d34cab1735ff9
188 Author: Apocalypse <perl@0ne.us>
189 Date: Tue Mar 8 14:43:41 2011 -0700
190
191 fix some nits reported by PerlCritic
127 - Updates to the auto-generated files
192128
193 commit 602dac644a11b2331217895056e034d9226310b4
194 Author: Apocalypse <perl@0ne.us>
195 Date: Tue Mar 8 13:27:32 2011 -0700
196
197 tweak testsuite
129 - Tweaked the testsuite to use done_testing() for sanity, RT#66741
130 (thanks
198131
199 commit 7ad6bbbc8e1d95f5dd4fbdb4df957e32eb31519c
200 Author: Apocalypse <perl@0ne.us>
201 Date: Tue Mar 8 12:45:28 2011 -0700
202
203 more doc tweaks
132 RCAPUTO!)
204133
205 commit 5079fc8f5c3e4a9275f5fab7a80a10910800f3e1
206 Author: Apocalypse <perl@0ne.us>
207 Date: Tue Mar 8 12:33:10 2011 -0700
208
209 add more connect fail tests
134 - Use Test::FailWarnings in the testsuite in place of
135 Test::NoWarnings
210136
211 commit 9700e8dd8f22d73bfeca5b2e603ad3eb85cb310c
212 Author: Apocalypse <perl@0ne.us>
213 Date: Tue Mar 8 12:32:56 2011 -0700
214
215 massive doc revamp
137 (DAGOLDEN++)
216138
217 commit 13dde50f6a039812fb8b335c0318ccf467b2331e
218 Author: Apocalypse <perl@0ne.us>
219 Date: Tue Mar 8 00:23:22 2011 -0700
220
221 add connfail test
139 - Add t/simple_large.t to try and track down RT#58243 (thanks Johan!)
222140
223 commit d96b80b1a4c1876d82e217677d0cdf33b1f68160
224 Author: Apocalypse <perl@0ne.us>
225 Date: Mon Mar 7 17:14:38 2011 -0700
226
227 add note about renegotiation and connection function
141 - Added a boatload of tests to try and track down RT#95071 (thanks
142 Joe!)
228143
229 commit 4df07a720ee9ad46fc39bb4fd39ad46db3c6a710
230 Author: Apocalypse <perl@0ne.us>
231 Date: Mon Mar 7 16:56:44 2011 -0700
232
233 add testcase for connref hooks
144 [STATISTICS]
234145
235 commit def0826f81ef2825c9be2c3a9aa2e0a3588c5489
236 Author: Apocalypse <perl@0ne.us>
237 Date: Mon Mar 7 16:55:24 2011 -0700
238
239 add GetStatus and finalize connref stuff
146 - code churn: 27 files changed, 2160 insertions(+), 1503 deletions(-)
240147
241 commit f5b8e4ae8016715cf5d9385d5771dac8dbe59abd
242 Author: Apocalypse <perl@0ne.us>
243 Date: Mon Mar 7 16:13:03 2011 -0700
244
245 more fixes and add hook testcase
148 Change: b717e75279e2b28ebd4b0d8ab0ce48cd7540998f
149 Author: Apocalypse <APOCAL@cpan.org>
150 Date : 2014-11-11 16:41:22 +0000
246151
247 commit 3e003c92bc922091587960de5a02c5bdfec36c8c
248 Author: Apocalypse <perl@0ne.us>
249 Date: Mon Mar 7 16:04:00 2011 -0700
250
251 add actual hook functionality for connection done
152 dont test superbig tests!
252153
253 commit 95ea76ec6e5a93cc8ff8b99df5a9b1558db27984
254 Author: Apocalypse <perl@0ne.us>
255 Date: Mon Mar 7 15:31:27 2011 -0700
256
257 initial commit for hook work
154 Change: e1aed14b94e9d1852b08208895262726d629fe3c
155 Author: Apocalypse <APOCAL@cpan.org>
156 Date : 2014-11-11 15:51:56 +0000
258157
259 commit d7914f5f0a6d9cd3065c23ab70f91d9912eba084
260 Author: Apocalypse <perl@0ne.us>
261 Date: Mon Mar 7 14:58:09 2011 -0700
262
263 use CTX_use_certificate_chain_file
158 tweak tests and add more large size tests
264159
265 =======================================
266 2011-02-28 08:52:48 -0700 release-1.003
267 =======================================
160 Change: 0d1324143216eb9cd1cf07ba0c2ac814a268cf6f
161 Author: Apocalypse <APOCAL@cpan.org>
162 Date : 2014-11-11 14:29:58 +0000
268163
269 commit dba0e05d424aeeb766bf887c1e731593777a6b5b
270 Author: Apocalypse <perl@0ne.us>
271 Date: Mon Feb 28 08:52:48 2011 -0700
272
273 New CPAN release of POE-Component-SSLify - v1.003
164 fix changes
274165
275 Released: 2011-02-28 15:52:24 UTC
166 Change: 7621d86c76c95fb7495717a4d4e0b912cfe51b97
167 Author: Apocalypse <APOCAL@cpan.org>
168 Date : 2014-11-11 14:27:39 +0000
276169
277 Add $IGNORE_SSL_ERRORS to ignore certain SSL errors, thanks MNUNBERG
278 - RT#66130
170 add test to try and track down RT#58243
279171
280 Remove prereq on vars.pm as it's obsolete
172 Change: 3db8619e947a14554c1a04ec8a8c5c0cac19acb5
173 Author: Apocalypse <APOCAL@cpan.org>
174 Date : 2014-11-11 14:10:54 +0000
281175
282 commit 367645dabcbc3ca12aae0c32d7a2e8847274865e
283 Author: Apocalypse <perl@0ne.us>
284 Date: Mon Feb 28 08:51:38 2011 -0700
285
286 add note about MSWin32
176 rename tests for clarity
287177
288 commit 8dfc5acbbad45910fc93a6688661fb5c46cffd59
289 Author: Apocalypse <perl@0ne.us>
290 Date: Mon Feb 28 08:46:09 2011 -0700
291
292 add IGNORE_SSL_ERRORS, thanks MNUNBERG
178 Change: ffbe1df7efa2ab2fd03230a44bdd14f0300bad5e
179 Author: Apocalypse <APOCAL@cpan.org>
180 Date : 2014-11-11 14:08:06 +0000
293181
294 commit cf26ebeb385b4a44dd20a1fa877905e3b948fd74
295 Author: Apocalypse <perl@0ne.us>
296 Date: Mon Feb 21 00:01:02 2011 -0700
297
298 add explicit Net::SSLeay version req
182 use Test::FailWarnings and migrate to done_testing
299183
300 =======================================
301 2011-02-19 21:24:02 -0700 release-1.002
302 =======================================
184 Change: f6a84928364e3a57e71733620bcbe8544a8ee6f2
185 Author: Apocalypse <APOCAL@cpan.org>
186 Date : 2014-11-11 14:00:30 +0000
303187
304 commit e20a8d5cd43978e14b22d50b884edc14f06a72c6
305 Author: Apocalypse <perl@0ne.us>
306 Date: Sat Feb 19 21:24:02 2011 -0700
307
308 New CPAN release of POE-Component-SSLify - v1.002
188 tweaks to POD and stuff to pass tests
309189
310 Released: 2011-02-20 04:23:48 UTC
190 Change: cd37d35eacaae2505f7d657b15d6e5820bf4f3fe
191 Author: Apocalypse <APOCAL@cpan.org>
192 Date : 2014-11-09 01:19:19 +0000
311193
312 Add SSLify_GetSSL to get the Net::SSLeay object, thanks mordy@irc!
194 mailmap
313195
314 commit b4269ddff7e04f09a8f304891469fbdc962e740c
315 Author: Apocalypse <perl@0ne.us>
316 Date: Sat Feb 19 21:19:21 2011 -0700
317
318 Add SSLify_GetSSL function, thanks mordy
319
320 =======================================
321 2011-02-13 11:11:22 -0700 release-1.001
322 =======================================
323
324 commit 6f65b4c33c787f306ec32033f6445be4b5b59516
325 Author: Apocalypse <perl@0ne.us>
326 Date: Sun Feb 13 11:11:22 2011 -0700
327
328 New CPAN release of POE-Component-SSLify - v1.001
329
330 Released: 2011-02-13 18:11:07 UTC
331
332 Fixed the Net::SSLeay import code, thanks CPANTesters!
333
334 commit 1627d797b6cd2a8a42de31312f699a5e514494ae
335 Author: Apocalypse <perl@0ne.us>
336 Date: Sun Feb 13 11:10:05 2011 -0700
337
338 use string eval instead of block eval, thanks CPANTesters
339
340 ===================================
341 End of changes in the last 365 days
342 ===================================
196 ================================================
197 Plus 9 releases after 2013-11-14 00:00:00 +0000.
198 ================================================
0
10 This is the Perl distribution POE-Component-SSLify.
21
32 Installing POE-Component-SSLify is straightforward.
2423 As a last resort, you can manually install it. Download the tarball, untar it,
2524 then build it:
2625
27 % perl Makefile.PL
28 % make && make test
26 % perl Build.PL
27 % ./Build && ./Build test
2928
3029 Then install it:
3130
32 % make install
31 % ./Build install
3332
3433 If you are installing into a system-wide directory, you may need to run:
3534
36 % sudo make install
35 % sudo ./Build install
3736
3837 ## Documentation
3938
0 This software is copyright (c) 2011 by Apocalypse.
0 This software is copyright (c) 2014 by Apocalypse.
11
22 This is free software; you can redistribute it and/or modify it under
33 the same terms as the Perl 5 programming language system itself.
1111
1212 --- The GNU General Public License, Version 1, February 1989 ---
1313
14 This software is Copyright (c) 2011 by Apocalypse.
14 This software is Copyright (c) 2014 by Apocalypse.
1515
1616 This is free software, licensed under:
1717
1818 The GNU General Public License, Version 1, February 1989
1919
20 GNU GENERAL PUBLIC LICENSE
21 Version 1, February 1989
20 GNU GENERAL PUBLIC LICENSE
21 Version 1, February 1989
2222
2323 Copyright (C) 1989 Free Software Foundation, Inc.
24 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
24 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
2526 Everyone is permitted to copy and distribute verbatim copies
2627 of this license document, but changing it is not allowed.
2728
28 Preamble
29 Preamble
2930
3031 The license agreements of most software companies try to keep users
3132 at the mercy of those companies. By contrast, our General Public
6667 The precise terms and conditions for copying, distribution and
6768 modification follow.
6869
69 GNU GENERAL PUBLIC LICENSE
70 GNU GENERAL PUBLIC LICENSE
7071 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
7172
7273 0. This License Agreement applies to any program or other work which
184185 of preserving the free status of all derivatives of our free software and
185186 of promoting the sharing and reuse of software generally.
186187
187 NO WARRANTY
188 NO WARRANTY
188189
189190 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
190191 FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
206207 PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
207208 POSSIBILITY OF SUCH DAMAGES.
208209
209 END OF TERMS AND CONDITIONS
210
211 Appendix: How to Apply These Terms to Your New Programs
210 END OF TERMS AND CONDITIONS
211
212 Appendix: How to Apply These Terms to Your New Programs
212213
213214 If you develop a new program, and you want it to be of the greatest
214215 possible use to humanity, the best way to achieve this is to make it
234235 GNU General Public License for more details.
235236
236237 You should have received a copy of the GNU General Public License
237 along with this program; if not, write to the Free Software Foundation,
238 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
238 along with this program; if not, write to the Free Software
239 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
240
239241
240242 Also add information on how to contact you by electronic and paper mail.
241243
269271
270272 --- The Artistic License 1.0 ---
271273
272 This software is Copyright (c) 2011 by Apocalypse.
274 This software is Copyright (c) 2014 by Apocalypse.
273275
274276 This is free software, licensed under:
275277
0 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.024.
1 AUTHOR_PLEDGE
02 Build.PL
13 Changes
24 CommitLog
911 Makefile.PL
1012 README
1113 SIGNATURE
14 cpanfile
1215 dist.ini
16 doap.xml
1317 examples/client.pl
1418 examples/server.pl
1519 examples/serverclient.pl
1923 mylib/example.crt
2024 mylib/example.key
2125 t/00-compile.t
22 t/000-report-versions-tiny.t
23 t/1_simple.t
24 t/2_renegotiate_client.t
25 t/3_upgrade.t
26 t/4_connect_hook.t
27 t/5_connfail_client.t
28 t/6_connfail_server.t
29 t/7_connect_hook_nodata.t
30 t/8_renegotiate_server.t
31 t/98_renegotiate.t
26 t/00-report-prereqs.dd
27 t/00-report-prereqs.t
28 t/00-ssleay-info.t
3229 t/99_mire_test.t
3330 t/apocalypse.t
31 t/connect_hook.t
32 t/connect_hook_nodata.t
33 t/connfail_client.t
34 t/connfail_server.t
35 t/renegotiate_client.t
36 t/renegotiate_client_pings.t
37 t/renegotiate_server.t
38 t/simple.t
39 t/simple_large.t
40 t/simple_parallel.t
41 t/simple_parallel_large.t
42 t/simple_parallel_superbig.t
43 t/simple_superbig.t
44 t/upgrade.t
0 # Added by Dist::Zilla::PluginBundle::Apocalyptic v0.001
0 # Added by Dist::Zilla::PluginBundle::Apocalyptic v0.006
11
22 # skip Eclipse IDE stuff
33 \.includepath$
33 "Apocalypse <APOCAL@cpan.org>"
44 ],
55 "dynamic_config" : 0,
6 "generated_by" : "Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.102400",
6 "generated_by" : "Dist::Zilla version 5.024, CPAN::Meta::Converter version 2.142690",
77 "license" : [
88 "perl_5"
99 ],
2020 ]
2121 },
2222 "prereqs" : {
23 "build" : {
24 "requires" : {
25 "Module::Build" : "0.3601"
26 }
27 },
2823 "configure" : {
2924 "requires" : {
30 "Module::Build" : "0.3601"
25 "ExtUtils::MakeMaker" : "0",
26 "Module::Build::Tiny" : "0.039",
27 "perl" : "5.006"
3128 }
3229 },
3330 "runtime" : {
3431 "requires" : {
35 "Exporter" : 0,
32 "Exporter" : "0",
3633 "IO::Handle" : "1.28",
3734 "Net::SSLeay" : "1.36",
38 "POE" : 0,
39 "Scalar::Util" : 0,
40 "Symbol" : 0,
35 "POE" : "1.267",
36 "Scalar::Util" : "0",
37 "Symbol" : "0",
4138 "Task::Weaken" : "1.03",
42 "parent" : 0,
43 "perl" : "5.006"
39 "parent" : "0",
40 "perl" : "5.006",
41 "strict" : "0",
42 "warnings" : "0"
4443 }
4544 },
4645 "test" : {
46 "recommends" : {
47 "CPAN::Meta" : "2.120900"
48 },
4749 "requires" : {
48 "File::Find" : 0,
49 "File::Temp" : 0,
50 "ExtUtils::MakeMaker" : "0",
51 "File::Spec" : "0",
52 "File::Temp" : "0",
53 "IO::Handle" : "1.28",
54 "IPC::Open3" : "0",
5055 "POE" : "1.267",
51 "POE::Component::Client::TCP" : 0,
52 "POE::Component::Server::TCP" : 0,
53 "Socket" : 0,
54 "Test::More" : "0.88"
56 "POE::Component::Client::TCP" : "0",
57 "POE::Component::Server::TCP" : "0",
58 "POE::Filter::Stream" : "0",
59 "Socket" : "0",
60 "Test::FailWarnings" : "0",
61 "Test::More" : "1.001002",
62 "perl" : "5.006"
5563 }
5664 }
5765 },
5866 "provides" : {
5967 "POE::Component::SSLify" : {
6068 "file" : "lib/POE/Component/SSLify.pm",
61 "version" : "1.008"
69 "version" : "1.012"
6270 },
6371 "POE::Component::SSLify::ClientHandle" : {
6472 "file" : "lib/POE/Component/SSLify/ClientHandle.pm",
65 "version" : "1.008"
73 "version" : "1.012"
6674 },
6775 "POE::Component::SSLify::ServerHandle" : {
6876 "file" : "lib/POE/Component/SSLify/ServerHandle.pm",
69 "version" : "1.008"
77 "version" : "1.012"
7078 }
7179 },
7280 "release_status" : "stable",
7583 "mailto" : "bug-poe-component-sslify at rt.cpan.org",
7684 "web" : "http://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-SSLify"
7785 },
78 "homepage" : "http://search.cpan.org/dist/POE-Component-SSLify/",
86 "homepage" : "https://github.com/apocalypse/perl-poe-sslify",
7987 "license" : [
8088 "http://dev.perl.org/licenses/"
8189 ],
8290 "repository" : {
8391 "type" : "git",
84 "url" : "git://github.com/apocalypse/perl-poe-sslify.git",
85 "web" : "http://github.com/apocalypse/perl-poe-sslify"
92 "url" : "https://github.com/apocalypse/perl-poe-sslify.git",
93 "web" : "https://github.com/apocalypse/perl-poe-sslify"
8694 }
8795 },
88 "version" : "1.008",
96 "version" : "1.012",
8997 "x_BuiltWith" : {
9098 "modules" : {
91 "Exporter" : "5.63",
92 "File::Find" : "1.12",
93 "File::Temp" : "0.22",
94 "IO::Handle" : "1.28",
95 "Module::Build" : "0.3607",
96 "Net::SSLeay" : "1.36",
97 "POE" : "1.310",
98 "POE::Component::Client::TCP" : "1.299",
99 "POE::Component::Server::TCP" : "1.299",
100 "Scalar::Util" : "1.23",
101 "Socket" : "1.80",
102 "Symbol" : "1.06",
103 "Task::Weaken" : "1.03",
104 "Test::More" : "0.96",
105 "parent" : "0.224",
106 "perl" : "NA(skipped: perl)"
99 "CPAN::Meta" : "2.142690",
100 "Exporter" : "5.70",
101 "ExtUtils::MakeMaker" : "7.00",
102 "File::Spec" : "3.47",
103 "File::Temp" : "0.2304",
104 "IO::Handle" : "1.34",
105 "IPC::Open3" : "1.13",
106 "Module::Build::Tiny" : "0.039",
107 "Net::SSLeay" : "1.66",
108 "POE" : "1.365",
109 "POE::Component::Client::TCP" : "1.365",
110 "POE::Component::Server::TCP" : "1.365",
111 "POE::Filter::Stream" : "1.365",
112 "Scalar::Util" : "1.41",
113 "Socket" : "2.016",
114 "Symbol" : "1.07",
115 "Task::Weaken" : "1.04",
116 "Test::FailWarnings" : "0.008",
117 "Test::More" : "1.001009",
118 "parent" : "0.228",
119 "strict" : "1.07",
120 "warnings" : "1.18"
107121 },
108122 "perl" : {
109 "original" : "v5.10.0",
123 "original" : "v5.18.2",
110124 "qv" : 1,
111125 "version" : [
112126 5,
113 10,
114 0
127 18,
128 2
115129 ]
116130 },
117131 "platform" : "linux",
118 "uname" : "Linux 2.6.31-22-generic x86_64"
132 "uname" : "Linux 3.13.0-35-generic x86_64"
119133 },
120134 "x_Dist_Zilla" : {
135 "perl" : {
136 "version" : "5.018002"
137 },
121138 "plugins" : [
122139 {
123140 "class" : "Dist::Zilla::Plugin::Git::NextVersion",
141 "config" : {
142 "Dist::Zilla::Plugin::Git::NextVersion" : {
143 "first_version" : "0.001",
144 "version_by_branch" : "0",
145 "version_regexp" : "(?^:^release-(.+)$)"
146 },
147 "Dist::Zilla::Role::Git::Repo" : {
148 "repo_root" : "."
149 }
150 },
124151 "name" : "@Apocalyptic/Git::NextVersion",
125 "version" : "1.110500"
126 },
127 {
128 "class" : "Dist::Zilla::Plugin::GatherDir",
129 "name" : "@Apocalyptic/GatherDir",
130 "version" : "4.200005"
152 "version" : "2.025"
153 },
154 {
155 "class" : "Dist::Zilla::Plugin::Git::GatherDir",
156 "config" : {
157 "Dist::Zilla::Plugin::GatherDir" : {
158 "exclude_filename" : [
159 "README.pod"
160 ],
161 "exclude_match" : [],
162 "follow_symlinks" : "0",
163 "include_dotfiles" : "1",
164 "prefix" : "",
165 "prune_directory" : [],
166 "root" : "."
167 },
168 "Dist::Zilla::Plugin::Git::GatherDir" : {
169 "include_untracked" : "0"
170 },
171 "Dist::Zilla::Role::Git::Repo" : {
172 "repo_root" : "."
173 }
174 },
175 "name" : "@Apocalyptic/Git::GatherDir",
176 "version" : "2.025"
131177 },
132178 {
133179 "class" : "Dist::Zilla::Plugin::PruneCruft",
134180 "name" : "@Apocalyptic/PruneCruft",
135 "version" : "4.200005"
181 "version" : "5.024"
136182 },
137183 {
138184 "class" : "Dist::Zilla::Plugin::AutoPrereqs",
139185 "name" : "@Apocalyptic/AutoPrereqs",
140 "version" : "4.200005"
186 "version" : "5.024"
141187 },
142188 {
143189 "class" : "Dist::Zilla::Plugin::GenerateFile",
144190 "name" : "@Apocalyptic/MANIFEST.SKIP",
145 "version" : "4.200005"
191 "version" : "5.024"
146192 },
147193 {
148194 "class" : "Dist::Zilla::Plugin::ManifestSkip",
149195 "name" : "@Apocalyptic/ManifestSkip",
150 "version" : "4.200005"
151 },
152 {
153 "class" : "Dist::Zilla::Plugin::CompileTests",
154 "name" : "@Apocalyptic/CompileTests",
155 "version" : "1.103030"
196 "version" : "5.024"
197 },
198 {
199 "class" : "Dist::Zilla::Plugin::Test::Compile",
200 "config" : {
201 "Dist::Zilla::Plugin::Test::Compile" : {
202 "bail_out_on_fail" : "0",
203 "fail_on_warning" : "author",
204 "fake_home" : "1",
205 "filename" : "t/00-compile.t",
206 "module_finder" : [
207 ":InstallModules"
208 ],
209 "needs_display" : "0",
210 "phase" : "test",
211 "script_finder" : [
212 ":ExecFiles"
213 ],
214 "skips" : []
215 }
216 },
217 "name" : "@Apocalyptic/Test::Compile",
218 "version" : "2.051"
156219 },
157220 {
158221 "class" : "Dist::Zilla::Plugin::ApocalypseTests",
159222 "name" : "@Apocalyptic/ApocalypseTests",
160 "version" : "1.001"
161 },
162 {
163 "class" : "Dist::Zilla::Plugin::ReportVersions::Tiny",
164 "name" : "@Apocalyptic/ReportVersions::Tiny",
165 "version" : "1.03"
223 "version" : "1.002"
224 },
225 {
226 "class" : "Dist::Zilla::Plugin::Test::ReportPrereqs",
227 "name" : "@Apocalyptic/Test::ReportPrereqs",
228 "version" : "0.019"
166229 },
167230 {
168231 "class" : "Dist::Zilla::Plugin::Prepender",
169232 "name" : "@Apocalyptic/Prepender",
170 "version" : "1.101590"
233 "version" : "1.112280"
171234 },
172235 {
173236 "class" : "Dist::Zilla::Plugin::Authority",
174237 "name" : "@Apocalyptic/Authority",
175 "version" : "1.005"
238 "version" : "1.009"
239 },
240 {
241 "class" : "Dist::Zilla::Plugin::Git::Describe",
242 "name" : "@Apocalyptic/Git::Describe",
243 "version" : "0.003"
176244 },
177245 {
178246 "class" : "Dist::Zilla::Plugin::PkgVersion",
179247 "name" : "@Apocalyptic/PkgVersion",
180 "version" : "4.200005"
248 "version" : "5.024"
181249 },
182250 {
183251 "class" : "Dist::Zilla::Plugin::PodWeaver",
252 "config" : {
253 "Dist::Zilla::Plugin::PodWeaver" : {
254 "config_plugins" : [
255 "@Apocalyptic"
256 ],
257 "finder" : [
258 ":InstallModules",
259 ":ExecFiles"
260 ],
261 "plugins" : [
262 {
263 "class" : "Pod::Weaver::Plugin::EnsurePod5",
264 "name" : "@CorePrep/EnsurePod5",
265 "version" : "4.006"
266 },
267 {
268 "class" : "Pod::Weaver::Plugin::H1Nester",
269 "name" : "@CorePrep/H1Nester",
270 "version" : "4.006"
271 },
272 {
273 "class" : "Pod::Weaver::Plugin::SingleEncoding",
274 "name" : "@Apocalyptic/SingleEncoding",
275 "version" : "4.006"
276 },
277 {
278 "class" : "Pod::Weaver::Section::Region",
279 "name" : "@Apocalyptic/PodCoverage",
280 "version" : "4.006"
281 },
282 {
283 "class" : "Pod::Weaver::Plugin::StopWords",
284 "name" : "@Apocalyptic/StopWords",
285 "version" : "1.009"
286 },
287 {
288 "class" : "Pod::Weaver::Section::Name",
289 "name" : "@Apocalyptic/Name",
290 "version" : "4.006"
291 },
292 {
293 "class" : "Pod::Weaver::Section::Version",
294 "name" : "@Apocalyptic/Version",
295 "version" : "4.006"
296 },
297 {
298 "class" : "Pod::Weaver::Section::Generic",
299 "name" : "@Apocalyptic/Synopsis",
300 "version" : "4.006"
301 },
302 {
303 "class" : "Pod::Weaver::Section::Generic",
304 "name" : "@Apocalyptic/Description",
305 "version" : "4.006"
306 },
307 {
308 "class" : "Pod::Weaver::Section::Collect",
309 "name" : "@Apocalyptic/Attributes",
310 "version" : "4.006"
311 },
312 {
313 "class" : "Pod::Weaver::Section::Collect",
314 "name" : "@Apocalyptic/Methods",
315 "version" : "4.006"
316 },
317 {
318 "class" : "Pod::Weaver::Section::Collect",
319 "name" : "@Apocalyptic/Functions",
320 "version" : "4.006"
321 },
322 {
323 "class" : "Pod::Weaver::Section::Collect",
324 "name" : "@Apocalyptic/POEvents",
325 "version" : "4.006"
326 },
327 {
328 "class" : "Pod::Weaver::Section::Leftovers",
329 "name" : "@Apocalyptic/Leftovers",
330 "version" : "4.006"
331 },
332 {
333 "class" : "Pod::Weaver::Section::SeeAlso",
334 "name" : "@Apocalyptic/SeeAlso",
335 "version" : "1.003"
336 },
337 {
338 "class" : "Pod::Weaver::Section::Support",
339 "name" : "@Apocalyptic/Support",
340 "version" : "1.006"
341 },
342 {
343 "class" : "Pod::Weaver::Section::Authors",
344 "name" : "@Apocalyptic/Authors",
345 "version" : "4.006"
346 },
347 {
348 "class" : "Pod::Weaver::Section::Contributors",
349 "name" : "@Apocalyptic/Contributors",
350 "version" : "0.008"
351 },
352 {
353 "class" : "Pod::Weaver::Section::Generic",
354 "name" : "@Apocalyptic/ACK",
355 "version" : "4.006"
356 },
357 {
358 "class" : "Pod::Weaver::Section::Legal",
359 "name" : "@Apocalyptic/Legal",
360 "version" : "4.006"
361 },
362 {
363 "class" : "Pod::Weaver::Section::WarrantyDisclaimer::GPL3",
364 "name" : "@Apocalyptic/Warranty",
365 "version" : "0.121290"
366 },
367 {
368 "class" : "Pod::Weaver::Plugin::Transformer",
369 "name" : "@Apocalyptic/ListTransformer",
370 "version" : "4.006"
371 },
372 {
373 "class" : "Pod::Weaver::Plugin::EnsureUniqueSections",
374 "name" : "@Apocalyptic/UniqueSections",
375 "version" : "0.121550"
376 }
377 ]
378 }
379 },
184380 "name" : "@Apocalyptic/PodWeaver",
185 "version" : "3.101641"
381 "version" : "4.006"
186382 },
187383 {
188384 "class" : "Dist::Zilla::Plugin::NextRelease",
189385 "name" : "@Apocalyptic/NextRelease",
190 "version" : "4.200005"
386 "version" : "5.024"
191387 },
192388 {
193389 "class" : "Dist::Zilla::Plugin::ChangelogFromGit",
194390 "name" : "@Apocalyptic/ChangelogFromGit",
195 "version" : "0.002"
391 "version" : "0.016"
196392 },
197393 {
198394 "class" : "Dist::Zilla::Plugin::MinimumPerl",
199395 "name" : "@Apocalyptic/MinimumPerl",
200 "version" : "1.003"
396 "version" : "1.006"
201397 },
202398 {
203399 "class" : "Dist::Zilla::Plugin::Bugtracker",
204400 "name" : "@Apocalyptic/Bugtracker",
205 "version" : "1.102670"
206 },
207 {
208 "class" : "Dist::Zilla::Plugin::Homepage",
209 "name" : "@Apocalyptic/Homepage",
210 "version" : "1.101420"
401 "version" : "1.111080"
211402 },
212403 {
213404 "class" : "Dist::Zilla::Plugin::MetaConfig",
214405 "name" : "@Apocalyptic/MetaConfig",
215 "version" : "4.200005"
406 "version" : "5.024"
407 },
408 {
409 "class" : "Dist::Zilla::Plugin::Git::Contributors",
410 "config" : {
411 "Dist::Zilla::Plugin::Git::Contributors" : {
412 "include_authors" : "0",
413 "include_releaser" : "1",
414 "order_by" : "name",
415 "paths" : []
416 }
417 },
418 "name" : "@Apocalyptic/Git::Contributors",
419 "version" : "0.008"
216420 },
217421 {
218422 "class" : "Dist::Zilla::Plugin::MetaData::BuiltWith",
219423 "config" : {
220424 "Dist::Zilla::Plugin::MetaData::BuiltWith" : {
221425 "_stash_key" : "x_BuiltWith",
222 "show_uname" : 1,
426 "show_config" : "0",
427 "show_uname" : "1",
223428 "uname" : {
224429 "uname_args" : [
225430 "-s",
231436 }
232437 },
233438 "name" : "@Apocalyptic/MetaData::BuiltWith",
234 "version" : "0.01018204"
235 },
236 {
237 "class" : "Dist::Zilla::Plugin::Repository",
238 "name" : "@Apocalyptic/Repository",
239 "version" : "0.16"
439 "version" : "1.003001"
440 },
441 {
442 "class" : "Dist::Zilla::Plugin::GithubMeta",
443 "name" : "@Apocalyptic/GithubMeta",
444 "version" : "0.46"
240445 },
241446 {
242447 "class" : "Dist::Zilla::Plugin::MetaResources",
243448 "name" : "@Apocalyptic/MetaResources",
244 "version" : "4.200005"
449 "version" : "5.024"
450 },
451 {
452 "class" : "Dist::Zilla::Plugin::Metadata",
453 "name" : "@Apocalyptic/Metadata",
454 "version" : "3.03"
245455 },
246456 {
247457 "class" : "Dist::Zilla::Plugin::MetaNoIndex",
248458 "name" : "@Apocalyptic/MetaNoIndex",
249 "version" : "4.200005"
459 "version" : "5.024"
250460 },
251461 {
252462 "class" : "Dist::Zilla::Plugin::MetaProvides::Package",
463 "config" : {
464 "Dist::Zilla::Plugin::MetaProvides::Package" : {
465 "finder_objects" : [
466 {
467 "class" : "Dist::Zilla::Plugin::FinderCode",
468 "name" : "@Apocalyptic/MetaProvides::Package/AUTOVIV/:InstallModulesPM",
469 "version" : "5.024"
470 }
471 ]
472 },
473 "Dist::Zilla::Role::MetaProvider::Provider" : {
474 "inherit_missing" : "1",
475 "inherit_version" : "1",
476 "meta_noindex" : "1"
477 }
478 },
253479 "name" : "@Apocalyptic/MetaProvides::Package",
254 "version" : "1.12044908"
480 "version" : "2.001002"
255481 },
256482 {
257483 "class" : "Dist::Zilla::Plugin::License",
258484 "name" : "@Apocalyptic/License",
259 "version" : "4.200005"
260 },
261 {
262 "class" : "Dist::Zilla::Plugin::MakeMaker",
263 "name" : "@Apocalyptic/MakeMaker",
264 "version" : "4.200005"
265 },
266 {
267 "class" : "Dist::Zilla::Plugin::ModuleBuild",
268 "name" : "@Apocalyptic/ModuleBuild",
269 "version" : "4.200005"
270 },
271 {
272 "class" : "Dist::Zilla::Plugin::DualBuilders",
273 "name" : "@Apocalyptic/DualBuilders",
274 "version" : "1.001"
485 "version" : "5.024"
486 },
487 {
488 "class" : "Dist::Zilla::Plugin::ModuleBuildTiny",
489 "config" : {
490 "Dist::Zilla::Role::TestRunner" : {
491 "default_jobs" : 1
492 }
493 },
494 "name" : "@Apocalyptic/ModuleBuildTiny",
495 "version" : "0.008"
496 },
497 {
498 "class" : "Dist::Zilla::Plugin::MakeMaker::Fallback",
499 "config" : {
500 "Dist::Zilla::Role::TestRunner" : {
501 "default_jobs" : 1
502 }
503 },
504 "name" : "@Apocalyptic/MakeMaker::Fallback",
505 "version" : "0.014"
275506 },
276507 {
277508 "class" : "Dist::Zilla::Plugin::MetaYAML",
278509 "name" : "@Apocalyptic/MetaYAML",
279 "version" : "4.200005"
510 "version" : "5.024"
280511 },
281512 {
282513 "class" : "Dist::Zilla::Plugin::MetaJSON",
283514 "name" : "@Apocalyptic/MetaJSON",
284 "version" : "4.200005"
285 },
286 {
287 "class" : "Dist::Zilla::Plugin::ReadmeFromPod",
288 "name" : "@Apocalyptic/ReadmeFromPod",
289 "version" : "0.14"
515 "version" : "5.024"
290516 },
291517 {
292518 "class" : "Dist::Zilla::Plugin::InstallGuide",
293519 "name" : "@Apocalyptic/InstallGuide",
294 "version" : "1.101461"
520 "version" : "1.200005"
521 },
522 {
523 "class" : "Dist::Zilla::Plugin::DOAP",
524 "name" : "@Apocalyptic/DOAP",
525 "version" : "0.003"
526 },
527 {
528 "class" : "Dist::Zilla::Plugin::Covenant",
529 "name" : "@Apocalyptic/Covenant",
530 "version" : "0.1.0"
531 },
532 {
533 "class" : "Dist::Zilla::Plugin::CPANFile",
534 "name" : "@Apocalyptic/CPANFile",
535 "version" : "5.024"
536 },
537 {
538 "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
539 "name" : "@Apocalyptic/ReadmeAnyFromPod",
540 "version" : "0.142470"
541 },
542 {
543 "class" : "Dist::Zilla::Plugin::ReadmeAnyFromPod",
544 "name" : "@Apocalyptic/pod for github",
545 "version" : "0.142470"
546 },
547 {
548 "class" : "Dist::Zilla::Plugin::ChangeStats::Git",
549 "name" : "@Apocalyptic/ChangeStats::Git",
550 "version" : "0.3.0"
295551 },
296552 {
297553 "class" : "Dist::Zilla::Plugin::Signature",
301557 {
302558 "class" : "Dist::Zilla::Plugin::Manifest",
303559 "name" : "@Apocalyptic/Manifest",
304 "version" : "4.200005"
560 "version" : "5.024"
305561 },
306562 {
307563 "class" : "Dist::Zilla::Plugin::CheckChangesHasContent",
308564 "name" : "@Apocalyptic/CheckChangesHasContent",
309 "version" : "0.003"
565 "version" : "0.007"
310566 },
311567 {
312568 "class" : "Dist::Zilla::Plugin::Git::Check",
569 "config" : {
570 "Dist::Zilla::Plugin::Git::Check" : {
571 "untracked_files" : "die"
572 },
573 "Dist::Zilla::Role::Git::DirtyFiles" : {
574 "allow_dirty" : [
575 "README.pod",
576 "Changes"
577 ],
578 "allow_dirty_match" : [],
579 "changelog" : "Changes"
580 },
581 "Dist::Zilla::Role::Git::Repo" : {
582 "repo_root" : "."
583 }
584 },
313585 "name" : "@Apocalyptic/Git::Check",
314 "version" : "1.110500"
586 "version" : "2.025"
587 },
588 {
589 "class" : "Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch",
590 "config" : {
591 "Dist::Zilla::Role::Git::Repo" : {
592 "repo_root" : "."
593 }
594 },
595 "name" : "@Apocalyptic/Git::CheckFor::CorrectBranch",
596 "version" : "0.011"
597 },
598 {
599 "class" : "Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts",
600 "config" : {
601 "Dist::Zilla::Role::Git::Repo" : {
602 "repo_root" : "."
603 }
604 },
605 "name" : "@Apocalyptic/Git::CheckFor::MergeConflicts",
606 "version" : "0.011"
607 },
608 {
609 "class" : "Dist::Zilla::Plugin::Git::Remote::Check",
610 "name" : "@Apocalyptic/Git::Remote::Check",
611 "version" : "0.1.2"
612 },
613 {
614 "class" : "Dist::Zilla::Plugin::PromptIfStale",
615 "config" : {
616 "Dist::Zilla::Plugin::PromptIfStale" : {
617 "check_all_plugins" : "1",
618 "check_all_prereqs" : "1",
619 "modules" : [],
620 "phase" : "release",
621 "skip" : []
622 }
623 },
624 "name" : "@Apocalyptic/PromptIfStale",
625 "version" : "0.029"
315626 },
316627 {
317628 "class" : "Dist::Zilla::Plugin::TestRelease",
318629 "name" : "@Apocalyptic/TestRelease",
319 "version" : "4.200005"
630 "version" : "5.024"
631 },
632 {
633 "class" : "Dist::Zilla::Plugin::CheckPrereqsIndexed",
634 "name" : "@Apocalyptic/CheckPrereqsIndexed",
635 "version" : "0.012"
636 },
637 {
638 "class" : "Dist::Zilla::Plugin::CheckSelfDependency",
639 "config" : {
640 "Dist::Zilla::Plugin::CheckSelfDependency" : {
641 "finder" : [
642 ":InstallModules"
643 ]
644 }
645 },
646 "name" : "@Apocalyptic/CheckSelfDependency",
647 "version" : "0.007"
648 },
649 {
650 "class" : "Dist::Zilla::Plugin::CheckIssues",
651 "name" : "@Apocalyptic/CheckIssues",
652 "version" : "0.004"
320653 },
321654 {
322655 "class" : "Dist::Zilla::Plugin::ConfirmRelease",
323656 "name" : "@Apocalyptic/ConfirmRelease",
324 "version" : "4.200005"
657 "version" : "5.024"
325658 },
326659 {
327660 "class" : "Dist::Zilla::Plugin::UploadToCPAN",
328661 "name" : "@Apocalyptic/UploadToCPAN",
329 "version" : "4.200005"
662 "version" : "5.024"
330663 },
331664 {
332665 "class" : "Dist::Zilla::Plugin::ArchiveRelease",
333666 "name" : "@Apocalyptic/ArchiveRelease",
334 "version" : "3.01"
667 "version" : "4.00"
335668 },
336669 {
337670 "class" : "Dist::Zilla::Plugin::Git::Commit",
671 "config" : {
672 "Dist::Zilla::Plugin::Git::Commit" : {
673 "add_files_in" : [
674 "releases"
675 ],
676 "commit_msg" : "New CPAN release of %N - v%v%n%n%c",
677 "time_zone" : "UTC"
678 },
679 "Dist::Zilla::Role::Git::DirtyFiles" : {
680 "allow_dirty" : [
681 "README.pod",
682 "Changes"
683 ],
684 "allow_dirty_match" : [],
685 "changelog" : "Changes"
686 },
687 "Dist::Zilla::Role::Git::Repo" : {
688 "repo_root" : "."
689 }
690 },
338691 "name" : "@Apocalyptic/Git::Commit",
339 "version" : "1.110500"
692 "version" : "2.025"
340693 },
341694 {
342695 "class" : "Dist::Zilla::Plugin::Git::Tag",
696 "config" : {
697 "Dist::Zilla::Plugin::Git::Tag" : {
698 "branch" : null,
699 "signed" : 0,
700 "tag" : "release-1.012",
701 "tag_format" : "release-%v",
702 "tag_message" : "Tagged release-%v",
703 "time_zone" : "local"
704 },
705 "Dist::Zilla::Role::Git::Repo" : {
706 "repo_root" : "."
707 }
708 },
343709 "name" : "@Apocalyptic/Git::Tag",
344 "version" : "1.110500"
710 "version" : "2.025"
345711 },
346712 {
347713 "class" : "Dist::Zilla::Plugin::Git::Push",
714 "config" : {
715 "Dist::Zilla::Plugin::Git::Push" : {
716 "push_to" : [
717 "origin",
718 "bitbucket"
719 ],
720 "remotes_must_exist" : 1
721 },
722 "Dist::Zilla::Role::Git::Repo" : {
723 "repo_root" : "."
724 }
725 },
348726 "name" : "@Apocalyptic/Git::Push",
349 "version" : "1.110500"
727 "version" : "2.025"
728 },
729 {
730 "class" : "Dist::Zilla::Plugin::GitHub::Update",
731 "name" : "@Apocalyptic/GitHub::Update",
732 "version" : "0.38"
733 },
734 {
735 "class" : "Dist::Zilla::Plugin::Bitbucket::Update",
736 "name" : "@Apocalyptic/Bitbucket::Update",
737 "version" : "0.001"
738 },
739 {
740 "class" : "Dist::Zilla::Plugin::Clean",
741 "name" : "@Apocalyptic/Clean",
742 "version" : "0.07"
743 },
744 {
745 "class" : "Dist::Zilla::Plugin::SchwartzRatio",
746 "name" : "@Apocalyptic/SchwartzRatio",
747 "version" : "0.2.0"
350748 },
351749 {
352750 "class" : "Dist::Zilla::Plugin::FinderCode",
353751 "name" : ":InstallModules",
354 "version" : "4.200005"
752 "version" : "5.024"
753 },
754 {
755 "class" : "Dist::Zilla::Plugin::FinderCode",
756 "name" : ":IncModules",
757 "version" : "5.024"
355758 },
356759 {
357760 "class" : "Dist::Zilla::Plugin::FinderCode",
358761 "name" : ":TestFiles",
359 "version" : "4.200005"
762 "version" : "5.024"
360763 },
361764 {
362765 "class" : "Dist::Zilla::Plugin::FinderCode",
363766 "name" : ":ExecFiles",
364 "version" : "4.200005"
767 "version" : "5.024"
365768 },
366769 {
367770 "class" : "Dist::Zilla::Plugin::FinderCode",
368771 "name" : ":ShareFiles",
369 "version" : "4.200005"
772 "version" : "5.024"
773 },
774 {
775 "class" : "Dist::Zilla::Plugin::FinderCode",
776 "name" : ":MainModule",
777 "version" : "5.024"
778 },
779 {
780 "class" : "Dist::Zilla::Plugin::FinderCode",
781 "name" : ":AllFiles",
782 "version" : "5.024"
783 },
784 {
785 "class" : "Dist::Zilla::Plugin::FinderCode",
786 "name" : ":NoFiles",
787 "version" : "5.024"
788 },
789 {
790 "class" : "Dist::Zilla::Plugin::VerifyPhases",
791 "name" : "@Apocalyptic/VerifyPhases",
792 "version" : "0.006"
793 },
794 {
795 "class" : "Dist::Zilla::Plugin::FinderCode",
796 "name" : "@Apocalyptic/MetaProvides::Package/AUTOVIV/:InstallModulesPM",
797 "version" : "5.024"
370798 }
371799 ],
372800 "zilla" : {
373801 "class" : "Dist::Zilla::Dist::Builder",
374802 "config" : {
375 "is_trial" : 0
376 },
377 "version" : "4.200005"
803 "is_trial" : "0"
804 },
805 "version" : "5.024"
378806 }
807 },
808 "x_IRC" : {
809 "url" : "irc://irc.perl.org/#perl-help",
810 "web" : "https://chat.mibbit.com/?channel=%23perl-help&server=irc.perl.org"
811 },
812 "x_author_pledge" : {
813 "version" : 1
379814 },
380815 "x_authority" : "cpan:APOCAL"
381816 }
382
+459
-127
META.yml less more
22 author:
33 - 'Apocalypse <APOCAL@cpan.org>'
44 build_requires:
5 File::Find: 0
6 File::Temp: 0
7 Module::Build: 0.3601
8 POE: 1.267
9 POE::Component::Client::TCP: 0
10 POE::Component::Server::TCP: 0
11 Socket: 0
12 Test::More: 0.88
5 ExtUtils::MakeMaker: '0'
6 File::Spec: '0'
7 File::Temp: '0'
8 IO::Handle: '1.28'
9 IPC::Open3: '0'
10 POE: '1.267'
11 POE::Component::Client::TCP: '0'
12 POE::Component::Server::TCP: '0'
13 POE::Filter::Stream: '0'
14 Socket: '0'
15 Test::FailWarnings: '0'
16 Test::More: '1.001002'
17 perl: '5.006'
1318 configure_requires:
14 Module::Build: 0.3601
15 dynamic_config: 0
16 generated_by: 'Dist::Zilla version 4.200005, CPAN::Meta::Converter version 2.102400'
19 ExtUtils::MakeMaker: '0'
20 Module::Build::Tiny: '0.039'
21 perl: '5.006'
22 dynamic_config: '0'
23 generated_by: 'Dist::Zilla version 5.024, CPAN::Meta::Converter version 2.142690'
1724 license: perl
1825 meta-spec:
1926 url: http://module-build.sourceforge.net/META-spec-v1.4.html
20 version: 1.4
27 version: '1.4'
2128 name: POE-Component-SSLify
2229 no_index:
2330 directory:
2734 provides:
2835 POE::Component::SSLify:
2936 file: lib/POE/Component/SSLify.pm
30 version: 1.008
37 version: '1.012'
3138 POE::Component::SSLify::ClientHandle:
3239 file: lib/POE/Component/SSLify/ClientHandle.pm
33 version: 1.008
40 version: '1.012'
3441 POE::Component::SSLify::ServerHandle:
3542 file: lib/POE/Component/SSLify/ServerHandle.pm
36 version: 1.008
43 version: '1.012'
3744 requires:
38 Exporter: 0
39 IO::Handle: 1.28
40 Net::SSLeay: 1.36
41 POE: 0
42 Scalar::Util: 0
43 Symbol: 0
44 Task::Weaken: 1.03
45 parent: 0
46 perl: 5.006
45 Exporter: '0'
46 IO::Handle: '1.28'
47 Net::SSLeay: '1.36'
48 POE: '1.267'
49 Scalar::Util: '0'
50 Symbol: '0'
51 Task::Weaken: '1.03'
52 parent: '0'
53 perl: '5.006'
54 strict: '0'
55 warnings: '0'
4756 resources:
4857 bugtracker: http://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-SSLify
49 homepage: http://search.cpan.org/dist/POE-Component-SSLify/
58 homepage: https://github.com/apocalypse/perl-poe-sslify
5059 license: http://dev.perl.org/licenses/
51 repository: git://github.com/apocalypse/perl-poe-sslify.git
52 version: 1.008
60 repository: https://github.com/apocalypse/perl-poe-sslify.git
61 version: '1.012'
5362 x_BuiltWith:
5463 modules:
55 Exporter: 5.63
56 File::Find: 1.12
57 File::Temp: 0.22
58 IO::Handle: 1.28
59 Module::Build: 0.3607
60 Net::SSLeay: 1.36
61 POE: 1.310
62 POE::Component::Client::TCP: 1.299
63 POE::Component::Server::TCP: 1.299
64 Scalar::Util: 1.23
65 Socket: 1.80
66 Symbol: 1.06
67 Task::Weaken: 1.03
68 Test::More: 0.96
69 parent: 0.224
70 perl: 'NA(skipped: perl)'
64 CPAN::Meta: '2.142690'
65 Exporter: '5.70'
66 ExtUtils::MakeMaker: '7.00'
67 File::Spec: '3.47'
68 File::Temp: '0.2304'
69 IO::Handle: '1.34'
70 IPC::Open3: '1.13'
71 Module::Build::Tiny: '0.039'
72 Net::SSLeay: '1.66'
73 POE: '1.365'
74 POE::Component::Client::TCP: '1.365'
75 POE::Component::Server::TCP: '1.365'
76 POE::Filter::Stream: '1.365'
77 Scalar::Util: '1.41'
78 Socket: '2.016'
79 Symbol: '1.07'
80 Task::Weaken: '1.04'
81 Test::FailWarnings: '0.008'
82 Test::More: '1.001009'
83 parent: '0.228'
84 strict: '1.07'
85 warnings: '1.18'
7186 perl:
72 original: v5.10.0
87 original: v5.18.2
7388 qv: 1
7489 version:
7590 - 5
76 - 10
77 - 0
91 - 18
92 - 2
7893 platform: linux
79 uname: 'Linux 2.6.31-22-generic x86_64'
94 uname: 'Linux 3.13.0-35-generic x86_64'
8095 x_Dist_Zilla:
96 perl:
97 version: '5.018002'
8198 plugins:
8299 -
83100 class: Dist::Zilla::Plugin::Git::NextVersion
101 config:
102 Dist::Zilla::Plugin::Git::NextVersion:
103 first_version: '0.001'
104 version_by_branch: '0'
105 version_regexp: (?^:^release-(.+)$)
106 Dist::Zilla::Role::Git::Repo:
107 repo_root: .
84108 name: '@Apocalyptic/Git::NextVersion'
85 version: 1.110500
86 -
87 class: Dist::Zilla::Plugin::GatherDir
88 name: '@Apocalyptic/GatherDir'
89 version: 4.200005
109 version: '2.025'
110 -
111 class: Dist::Zilla::Plugin::Git::GatherDir
112 config:
113 Dist::Zilla::Plugin::GatherDir:
114 exclude_filename:
115 - README.pod
116 exclude_match: []
117 follow_symlinks: '0'
118 include_dotfiles: '1'
119 prefix: ''
120 prune_directory: []
121 root: .
122 Dist::Zilla::Plugin::Git::GatherDir:
123 include_untracked: '0'
124 Dist::Zilla::Role::Git::Repo:
125 repo_root: .
126 name: '@Apocalyptic/Git::GatherDir'
127 version: '2.025'
90128 -
91129 class: Dist::Zilla::Plugin::PruneCruft
92130 name: '@Apocalyptic/PruneCruft'
93 version: 4.200005
131 version: '5.024'
94132 -
95133 class: Dist::Zilla::Plugin::AutoPrereqs
96134 name: '@Apocalyptic/AutoPrereqs'
97 version: 4.200005
135 version: '5.024'
98136 -
99137 class: Dist::Zilla::Plugin::GenerateFile
100138 name: '@Apocalyptic/MANIFEST.SKIP'
101 version: 4.200005
139 version: '5.024'
102140 -
103141 class: Dist::Zilla::Plugin::ManifestSkip
104142 name: '@Apocalyptic/ManifestSkip'
105 version: 4.200005
106 -
107 class: Dist::Zilla::Plugin::CompileTests
108 name: '@Apocalyptic/CompileTests'
109 version: 1.103030
143 version: '5.024'
144 -
145 class: Dist::Zilla::Plugin::Test::Compile
146 config:
147 Dist::Zilla::Plugin::Test::Compile:
148 bail_out_on_fail: '0'
149 fail_on_warning: author
150 fake_home: '1'
151 filename: t/00-compile.t
152 module_finder:
153 - ':InstallModules'
154 needs_display: '0'
155 phase: test
156 script_finder:
157 - ':ExecFiles'
158 skips: []
159 name: '@Apocalyptic/Test::Compile'
160 version: '2.051'
110161 -
111162 class: Dist::Zilla::Plugin::ApocalypseTests
112163 name: '@Apocalyptic/ApocalypseTests'
113 version: 1.001
114 -
115 class: Dist::Zilla::Plugin::ReportVersions::Tiny
116 name: '@Apocalyptic/ReportVersions::Tiny'
117 version: 1.03
164 version: '1.002'
165 -
166 class: Dist::Zilla::Plugin::Test::ReportPrereqs
167 name: '@Apocalyptic/Test::ReportPrereqs'
168 version: '0.019'
118169 -
119170 class: Dist::Zilla::Plugin::Prepender
120171 name: '@Apocalyptic/Prepender'
121 version: 1.101590
172 version: '1.112280'
122173 -
123174 class: Dist::Zilla::Plugin::Authority
124175 name: '@Apocalyptic/Authority'
125 version: 1.005
176 version: '1.009'
177 -
178 class: Dist::Zilla::Plugin::Git::Describe
179 name: '@Apocalyptic/Git::Describe'
180 version: '0.003'
126181 -
127182 class: Dist::Zilla::Plugin::PkgVersion
128183 name: '@Apocalyptic/PkgVersion'
129 version: 4.200005
184 version: '5.024'
130185 -
131186 class: Dist::Zilla::Plugin::PodWeaver
187 config:
188 Dist::Zilla::Plugin::PodWeaver:
189 config_plugins:
190 - '@Apocalyptic'
191 finder:
192 - ':InstallModules'
193 - ':ExecFiles'
194 plugins:
195 -
196 class: Pod::Weaver::Plugin::EnsurePod5
197 name: '@CorePrep/EnsurePod5'
198 version: '4.006'
199 -
200 class: Pod::Weaver::Plugin::H1Nester
201 name: '@CorePrep/H1Nester'
202 version: '4.006'
203 -
204 class: Pod::Weaver::Plugin::SingleEncoding
205 name: '@Apocalyptic/SingleEncoding'
206 version: '4.006'
207 -
208 class: Pod::Weaver::Section::Region
209 name: '@Apocalyptic/PodCoverage'
210 version: '4.006'
211 -
212 class: Pod::Weaver::Plugin::StopWords
213 name: '@Apocalyptic/StopWords'
214 version: '1.009'
215 -
216 class: Pod::Weaver::Section::Name
217 name: '@Apocalyptic/Name'
218 version: '4.006'
219 -
220 class: Pod::Weaver::Section::Version
221 name: '@Apocalyptic/Version'
222 version: '4.006'
223 -
224 class: Pod::Weaver::Section::Generic
225 name: '@Apocalyptic/Synopsis'
226 version: '4.006'
227 -
228 class: Pod::Weaver::Section::Generic
229 name: '@Apocalyptic/Description'
230 version: '4.006'
231 -
232 class: Pod::Weaver::Section::Collect
233 name: '@Apocalyptic/Attributes'
234 version: '4.006'
235 -
236 class: Pod::Weaver::Section::Collect
237 name: '@Apocalyptic/Methods'
238 version: '4.006'
239 -
240 class: Pod::Weaver::Section::Collect
241 name: '@Apocalyptic/Functions'
242 version: '4.006'
243 -
244 class: Pod::Weaver::Section::Collect
245 name: '@Apocalyptic/POEvents'
246 version: '4.006'
247 -
248 class: Pod::Weaver::Section::Leftovers
249 name: '@Apocalyptic/Leftovers'
250 version: '4.006'
251 -
252 class: Pod::Weaver::Section::SeeAlso
253 name: '@Apocalyptic/SeeAlso'
254 version: '1.003'
255 -
256 class: Pod::Weaver::Section::Support
257 name: '@Apocalyptic/Support'
258 version: '1.006'
259 -
260 class: Pod::Weaver::Section::Authors
261 name: '@Apocalyptic/Authors'
262 version: '4.006'
263 -
264 class: Pod::Weaver::Section::Contributors
265 name: '@Apocalyptic/Contributors'
266 version: '0.008'
267 -
268 class: Pod::Weaver::Section::Generic
269 name: '@Apocalyptic/ACK'
270 version: '4.006'
271 -
272 class: Pod::Weaver::Section::Legal
273 name: '@Apocalyptic/Legal'
274 version: '4.006'
275 -
276 class: Pod::Weaver::Section::WarrantyDisclaimer::GPL3
277 name: '@Apocalyptic/Warranty'
278 version: '0.121290'
279 -
280 class: Pod::Weaver::Plugin::Transformer
281 name: '@Apocalyptic/ListTransformer'
282 version: '4.006'
283 -
284 class: Pod::Weaver::Plugin::EnsureUniqueSections
285 name: '@Apocalyptic/UniqueSections'
286 version: '0.121550'
132287 name: '@Apocalyptic/PodWeaver'
133 version: 3.101641
288 version: '4.006'
134289 -
135290 class: Dist::Zilla::Plugin::NextRelease
136291 name: '@Apocalyptic/NextRelease'
137 version: 4.200005
292 version: '5.024'
138293 -
139294 class: Dist::Zilla::Plugin::ChangelogFromGit
140295 name: '@Apocalyptic/ChangelogFromGit'
141 version: 0.002
296 version: '0.016'
142297 -
143298 class: Dist::Zilla::Plugin::MinimumPerl
144299 name: '@Apocalyptic/MinimumPerl'
145 version: 1.003
300 version: '1.006'
146301 -
147302 class: Dist::Zilla::Plugin::Bugtracker
148303 name: '@Apocalyptic/Bugtracker'
149 version: 1.102670
150 -
151 class: Dist::Zilla::Plugin::Homepage
152 name: '@Apocalyptic/Homepage'
153 version: 1.101420
304 version: '1.111080'
154305 -
155306 class: Dist::Zilla::Plugin::MetaConfig
156307 name: '@Apocalyptic/MetaConfig'
157 version: 4.200005
308 version: '5.024'
309 -
310 class: Dist::Zilla::Plugin::Git::Contributors
311 config:
312 Dist::Zilla::Plugin::Git::Contributors:
313 include_authors: '0'
314 include_releaser: '1'
315 order_by: name
316 paths: []
317 name: '@Apocalyptic/Git::Contributors'
318 version: '0.008'
158319 -
159320 class: Dist::Zilla::Plugin::MetaData::BuiltWith
160321 config:
161322 Dist::Zilla::Plugin::MetaData::BuiltWith:
162323 _stash_key: x_BuiltWith
163 show_uname: 1
324 show_config: '0'
325 show_uname: '1'
164326 uname:
165327 uname_args:
166 - '-s'
167 - '-r'
168 - '-m'
328 - -s
329 - -r
330 - -m
169331 uname_call: uname
170332 name: '@Apocalyptic/MetaData::BuiltWith'
171 version: 0.01018204
172 -
173 class: Dist::Zilla::Plugin::Repository
174 name: '@Apocalyptic/Repository'
175 version: 0.16
333 version: '1.003001'
334 -
335 class: Dist::Zilla::Plugin::GithubMeta
336 name: '@Apocalyptic/GithubMeta'
337 version: '0.46'
176338 -
177339 class: Dist::Zilla::Plugin::MetaResources
178340 name: '@Apocalyptic/MetaResources'
179 version: 4.200005
341 version: '5.024'
342 -
343 class: Dist::Zilla::Plugin::Metadata
344 name: '@Apocalyptic/Metadata'
345 version: '3.03'
180346 -
181347 class: Dist::Zilla::Plugin::MetaNoIndex
182348 name: '@Apocalyptic/MetaNoIndex'
183 version: 4.200005
349 version: '5.024'
184350 -
185351 class: Dist::Zilla::Plugin::MetaProvides::Package
352 config:
353 Dist::Zilla::Plugin::MetaProvides::Package:
354 finder_objects:
355 -
356 class: Dist::Zilla::Plugin::FinderCode
357 name: '@Apocalyptic/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
358 version: '5.024'
359 Dist::Zilla::Role::MetaProvider::Provider:
360 inherit_missing: '1'
361 inherit_version: '1'
362 meta_noindex: '1'
186363 name: '@Apocalyptic/MetaProvides::Package'
187 version: 1.12044908
364 version: '2.001002'
188365 -
189366 class: Dist::Zilla::Plugin::License
190367 name: '@Apocalyptic/License'
191 version: 4.200005
192 -
193 class: Dist::Zilla::Plugin::MakeMaker
194 name: '@Apocalyptic/MakeMaker'
195 version: 4.200005
196 -
197 class: Dist::Zilla::Plugin::ModuleBuild
198 name: '@Apocalyptic/ModuleBuild'
199 version: 4.200005
200 -
201 class: Dist::Zilla::Plugin::DualBuilders
202 name: '@Apocalyptic/DualBuilders'
203 version: 1.001
368 version: '5.024'
369 -
370 class: Dist::Zilla::Plugin::ModuleBuildTiny
371 config:
372 Dist::Zilla::Role::TestRunner:
373 default_jobs: '1'
374 name: '@Apocalyptic/ModuleBuildTiny'
375 version: '0.008'
376 -
377 class: Dist::Zilla::Plugin::MakeMaker::Fallback
378 config:
379 Dist::Zilla::Role::TestRunner:
380 default_jobs: '1'
381 name: '@Apocalyptic/MakeMaker::Fallback'
382 version: '0.014'
204383 -
205384 class: Dist::Zilla::Plugin::MetaYAML
206385 name: '@Apocalyptic/MetaYAML'
207 version: 4.200005
386 version: '5.024'
208387 -
209388 class: Dist::Zilla::Plugin::MetaJSON
210389 name: '@Apocalyptic/MetaJSON'
211 version: 4.200005
212 -
213 class: Dist::Zilla::Plugin::ReadmeFromPod
214 name: '@Apocalyptic/ReadmeFromPod'
215 version: 0.14
390 version: '5.024'
216391 -
217392 class: Dist::Zilla::Plugin::InstallGuide
218393 name: '@Apocalyptic/InstallGuide'
219 version: 1.101461
394 version: '1.200005'
395 -
396 class: Dist::Zilla::Plugin::DOAP
397 name: '@Apocalyptic/DOAP'
398 version: '0.003'
399 -
400 class: Dist::Zilla::Plugin::Covenant
401 name: '@Apocalyptic/Covenant'
402 version: 0.1.0
403 -
404 class: Dist::Zilla::Plugin::CPANFile
405 name: '@Apocalyptic/CPANFile'
406 version: '5.024'
407 -
408 class: Dist::Zilla::Plugin::ReadmeAnyFromPod
409 name: '@Apocalyptic/ReadmeAnyFromPod'
410 version: '0.142470'
411 -
412 class: Dist::Zilla::Plugin::ReadmeAnyFromPod
413 name: '@Apocalyptic/pod for github'
414 version: '0.142470'
415 -
416 class: Dist::Zilla::Plugin::ChangeStats::Git
417 name: '@Apocalyptic/ChangeStats::Git'
418 version: 0.3.0
220419 -
221420 class: Dist::Zilla::Plugin::Signature
222421 name: '@Apocalyptic/Signature'
223 version: 1.100930
422 version: '1.100930'
224423 -
225424 class: Dist::Zilla::Plugin::Manifest
226425 name: '@Apocalyptic/Manifest'
227 version: 4.200005
426 version: '5.024'
228427 -
229428 class: Dist::Zilla::Plugin::CheckChangesHasContent
230429 name: '@Apocalyptic/CheckChangesHasContent'
231 version: 0.003
430 version: '0.007'
232431 -
233432 class: Dist::Zilla::Plugin::Git::Check
433 config:
434 Dist::Zilla::Plugin::Git::Check:
435 untracked_files: die
436 Dist::Zilla::Role::Git::DirtyFiles:
437 allow_dirty:
438 - README.pod
439 - Changes
440 allow_dirty_match: []
441 changelog: Changes
442 Dist::Zilla::Role::Git::Repo:
443 repo_root: .
234444 name: '@Apocalyptic/Git::Check'
235 version: 1.110500
445 version: '2.025'
446 -
447 class: Dist::Zilla::Plugin::Git::CheckFor::CorrectBranch
448 config:
449 Dist::Zilla::Role::Git::Repo:
450 repo_root: .
451 name: '@Apocalyptic/Git::CheckFor::CorrectBranch'
452 version: '0.011'
453 -
454 class: Dist::Zilla::Plugin::Git::CheckFor::MergeConflicts
455 config:
456 Dist::Zilla::Role::Git::Repo:
457 repo_root: .
458 name: '@Apocalyptic/Git::CheckFor::MergeConflicts'
459 version: '0.011'
460 -
461 class: Dist::Zilla::Plugin::Git::Remote::Check
462 name: '@Apocalyptic/Git::Remote::Check'
463 version: 0.1.2
464 -
465 class: Dist::Zilla::Plugin::PromptIfStale
466 config:
467 Dist::Zilla::Plugin::PromptIfStale:
468 check_all_plugins: '1'
469 check_all_prereqs: '1'
470 modules: []
471 phase: release
472 skip: []
473 name: '@Apocalyptic/PromptIfStale'
474 version: '0.029'
236475 -
237476 class: Dist::Zilla::Plugin::TestRelease
238477 name: '@Apocalyptic/TestRelease'
239 version: 4.200005
478 version: '5.024'
479 -
480 class: Dist::Zilla::Plugin::CheckPrereqsIndexed
481 name: '@Apocalyptic/CheckPrereqsIndexed'
482 version: '0.012'
483 -
484 class: Dist::Zilla::Plugin::CheckSelfDependency
485 config:
486 Dist::Zilla::Plugin::CheckSelfDependency:
487 finder:
488 - ':InstallModules'
489 name: '@Apocalyptic/CheckSelfDependency'
490 version: '0.007'
491 -
492 class: Dist::Zilla::Plugin::CheckIssues
493 name: '@Apocalyptic/CheckIssues'
494 version: '0.004'
240495 -
241496 class: Dist::Zilla::Plugin::ConfirmRelease
242497 name: '@Apocalyptic/ConfirmRelease'
243 version: 4.200005
498 version: '5.024'
244499 -
245500 class: Dist::Zilla::Plugin::UploadToCPAN
246501 name: '@Apocalyptic/UploadToCPAN'
247 version: 4.200005
502 version: '5.024'
248503 -
249504 class: Dist::Zilla::Plugin::ArchiveRelease
250505 name: '@Apocalyptic/ArchiveRelease'
251 version: 3.01
506 version: '4.00'
252507 -
253508 class: Dist::Zilla::Plugin::Git::Commit
509 config:
510 Dist::Zilla::Plugin::Git::Commit:
511 add_files_in:
512 - releases
513 commit_msg: 'New CPAN release of %N - v%v%n%n%c'
514 time_zone: UTC
515 Dist::Zilla::Role::Git::DirtyFiles:
516 allow_dirty:
517 - README.pod
518 - Changes
519 allow_dirty_match: []
520 changelog: Changes
521 Dist::Zilla::Role::Git::Repo:
522 repo_root: .
254523 name: '@Apocalyptic/Git::Commit'
255 version: 1.110500
524 version: '2.025'
256525 -
257526 class: Dist::Zilla::Plugin::Git::Tag
527 config:
528 Dist::Zilla::Plugin::Git::Tag:
529 branch: ~
530 signed: '0'
531 tag: release-1.012
532 tag_format: release-%v
533 tag_message: 'Tagged release-%v'
534 time_zone: local
535 Dist::Zilla::Role::Git::Repo:
536 repo_root: .
258537 name: '@Apocalyptic/Git::Tag'
259 version: 1.110500
538 version: '2.025'
260539 -
261540 class: Dist::Zilla::Plugin::Git::Push
541 config:
542 Dist::Zilla::Plugin::Git::Push:
543 push_to:
544 - origin
545 - bitbucket
546 remotes_must_exist: '1'
547 Dist::Zilla::Role::Git::Repo:
548 repo_root: .
262549 name: '@Apocalyptic/Git::Push'
263 version: 1.110500
550 version: '2.025'
551 -
552 class: Dist::Zilla::Plugin::GitHub::Update
553 name: '@Apocalyptic/GitHub::Update'
554 version: '0.38'
555 -
556 class: Dist::Zilla::Plugin::Bitbucket::Update
557 name: '@Apocalyptic/Bitbucket::Update'
558 version: '0.001'
559 -
560 class: Dist::Zilla::Plugin::Clean
561 name: '@Apocalyptic/Clean'
562 version: '0.07'
563 -
564 class: Dist::Zilla::Plugin::SchwartzRatio
565 name: '@Apocalyptic/SchwartzRatio'
566 version: 0.2.0
264567 -
265568 class: Dist::Zilla::Plugin::FinderCode
266569 name: ':InstallModules'
267 version: 4.200005
570 version: '5.024'
571 -
572 class: Dist::Zilla::Plugin::FinderCode
573 name: ':IncModules'
574 version: '5.024'
268575 -
269576 class: Dist::Zilla::Plugin::FinderCode
270577 name: ':TestFiles'
271 version: 4.200005
578 version: '5.024'
272579 -
273580 class: Dist::Zilla::Plugin::FinderCode
274581 name: ':ExecFiles'
275 version: 4.200005
582 version: '5.024'
276583 -
277584 class: Dist::Zilla::Plugin::FinderCode
278585 name: ':ShareFiles'
279 version: 4.200005
586 version: '5.024'
587 -
588 class: Dist::Zilla::Plugin::FinderCode
589 name: ':MainModule'
590 version: '5.024'
591 -
592 class: Dist::Zilla::Plugin::FinderCode
593 name: ':AllFiles'
594 version: '5.024'
595 -
596 class: Dist::Zilla::Plugin::FinderCode
597 name: ':NoFiles'
598 version: '5.024'
599 -
600 class: Dist::Zilla::Plugin::VerifyPhases
601 name: '@Apocalyptic/VerifyPhases'
602 version: '0.006'
603 -
604 class: Dist::Zilla::Plugin::FinderCode
605 name: '@Apocalyptic/MetaProvides::Package/AUTOVIV/:InstallModulesPM'
606 version: '5.024'
280607 zilla:
281608 class: Dist::Zilla::Dist::Builder
282609 config:
283 is_trial: 0
284 version: 4.200005
610 is_trial: '0'
611 version: '5.024'
612 x_IRC:
613 url: irc://irc.perl.org/#perl-help
614 web: https://chat.mibbit.com/?channel=%23perl-help&server=irc.perl.org
615 x_author_pledge:
616 version: '1'
285617 x_authority: cpan:APOCAL
0 #
1 # This file is part of POE-Component-SSLify
2 #
3 # This software is copyright (c) 2014 by Apocalypse.
4 #
5 # This is free software; you can redistribute it and/or modify it under
6 # the same terms as the Perl 5 programming language system itself.
7 #
8 use strict; use warnings;
9 # This Makefile.PL for POE-Component-SSLify was generated by
10 # Dist::Zilla::Plugin::MakeMaker::Fallback 0.014
11 # and Dist::Zilla::Plugin::MakeMaker::Awesome 0.31.
12 # Don't edit it but the dist.ini and plugins used to construct it.
013
114 use strict;
215 use warnings;
316
4 BEGIN { require 5.006; }
17 BEGIN {
18 my %configure_requires = (
19 'ExtUtils::MakeMaker' => '0',
20 'Module::Build::Tiny' => '0.039',
21 );
522
6 use ExtUtils::MakeMaker 6.31;
23 my @missing = grep {
24 ! eval "require $_; $_->VERSION($configure_requires{$_}); 1"
25 } keys %configure_requires;
726
27 if (not @missing)
28 {
29 print "Congratulations, your toolchain understands 'configure_requires'!\n\n";
30 }
31 else
32 {
33 $ENV{PERL_MM_FALLBACK_SILENCE_WARNING} or warn <<'EOW';
34 *** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***
835
36 If you're seeing this warning, your toolchain is really, really old* and you'll
37 almost certainly have problems installing CPAN modules from this century. But
38 never fear, dear user, for we have the technology to fix this!
39
40 If you're using CPAN.pm to install things, then you can upgrade it using:
41
42 cpan CPAN
43
44 If you're using CPANPLUS to install things, then you can upgrade it using:
45
46 cpanp CPANPLUS
47
48 If you're using cpanminus, you shouldn't be seeing this message in the first
49 place, so please file an issue on github.
50
51 If you're installing manually, please retrain your fingers to run Build.PL
52 when present instead.
53
54 This public service announcement was brought to you by the Perl Toolchain
55 Gang, the irc.perl.org #toolchain IRC channel, and the number 42.
56
57 ----
58
59 * Alternatively, you are doing something overly clever, in which case you
60 should consider setting the 'prefer_installer' config option in CPAN.pm, or
61 'prefer_makefile' in CPANPLUS, to 'mb" and '0' respectively.
62
63 You can also silence this warning for future installations by setting the
64 PERL_MM_FALLBACK_SILENCE_WARNING environment variable.
65
66 EOW
67
68 sleep 10 if -t STDIN && (-t STDOUT || !(-f STDOUT || -c STDOUT));
69 }
70 }
71
72 use 5.006;
73 use ExtUtils::MakeMaker;
974
1075 my %WriteMakefileArgs = (
11 'ABSTRACT' => 'Makes using SSL in the world of POE easy!',
12 'AUTHOR' => 'Apocalypse <APOCAL@cpan.org>',
13 'BUILD_REQUIRES' => {
14 'File::Find' => '0',
15 'File::Temp' => '0',
16 'ExtUtils::MakeMaker' => '6.31',
17 'POE' => '1.267',
18 'POE::Component::Client::TCP' => '0',
19 'POE::Component::Server::TCP' => '0',
20 'Socket' => '0',
21 'Test::More' => '0.88'
76 "ABSTRACT" => "Makes using SSL in the world of POE easy!",
77 "AUTHOR" => "Apocalypse <APOCAL\@cpan.org>",
78 "CONFIGURE_REQUIRES" => {
79 "ExtUtils::MakeMaker" => 0,
80 "Module::Build::Tiny" => "0.039"
2281 },
23 'CONFIGURE_REQUIRES' => {
24 'ExtUtils::MakeMaker' => '6.31'
82 "DISTNAME" => "POE-Component-SSLify",
83 "EXE_FILES" => [],
84 "LICENSE" => "perl",
85 "MIN_PERL_VERSION" => "5.006",
86 "NAME" => "POE::Component::SSLify",
87 "PREREQ_PM" => {
88 "Exporter" => 0,
89 "IO::Handle" => "1.28",
90 "Net::SSLeay" => "1.36",
91 "POE" => "1.267",
92 "Scalar::Util" => 0,
93 "Symbol" => 0,
94 "Task::Weaken" => "1.03",
95 "parent" => 0,
96 "strict" => 0,
97 "warnings" => 0
2598 },
26 'DISTNAME' => 'POE-Component-SSLify',
27 'EXE_FILES' => [],
28 'LICENSE' => 'perl',
29 'NAME' => 'POE::Component::SSLify',
30 'PREREQ_PM' => {
31 'Exporter' => '0',
32 'IO::Handle' => '1.28',
33 'Net::SSLeay' => '1.36',
34 'POE' => '0',
35 'Scalar::Util' => '0',
36 'Symbol' => '0',
37 'Task::Weaken' => '1.03',
38 'parent' => '0'
99 "TEST_REQUIRES" => {
100 "ExtUtils::MakeMaker" => 0,
101 "File::Spec" => 0,
102 "File::Temp" => 0,
103 "IO::Handle" => "1.28",
104 "IPC::Open3" => 0,
105 "POE" => "1.267",
106 "POE::Component::Client::TCP" => 0,
107 "POE::Component::Server::TCP" => 0,
108 "POE::Filter::Stream" => 0,
109 "Socket" => 0,
110 "Test::FailWarnings" => 0,
111 "Test::More" => "1.001002"
39112 },
40 'VERSION' => '1.008',
41 'test' => {
42 'TESTS' => 't/*.t'
113 "VERSION" => "1.012",
114 "test" => {
115 "TESTS" => "t/*.t"
43116 }
44117 );
45118
119 my %FallbackPrereqs = (
120 "Exporter" => 0,
121 "ExtUtils::MakeMaker" => 0,
122 "File::Spec" => 0,
123 "File::Temp" => 0,
124 "IO::Handle" => "1.28",
125 "IPC::Open3" => 0,
126 "Module::Build::Tiny" => "0.039",
127 "Net::SSLeay" => "1.36",
128 "POE" => "1.267",
129 "POE::Component::Client::TCP" => 0,
130 "POE::Component::Server::TCP" => 0,
131 "POE::Filter::Stream" => 0,
132 "Scalar::Util" => 0,
133 "Socket" => 0,
134 "Symbol" => 0,
135 "Task::Weaken" => "1.03",
136 "Test::FailWarnings" => 0,
137 "Test::More" => "1.001002",
138 "parent" => 0,
139 "strict" => 0,
140 "warnings" => 0
141 );
46142
47 unless ( eval { ExtUtils::MakeMaker->VERSION(6.56) } ) {
48 my $br = delete $WriteMakefileArgs{BUILD_REQUIRES};
49 my $pp = $WriteMakefileArgs{PREREQ_PM};
50 for my $mod ( keys %$br ) {
51 if ( exists $pp->{$mod} ) {
52 $pp->{$mod} = $br->{$mod} if $br->{$mod} > $pp->{$mod};
53 }
54 else {
55 $pp->{$mod} = $br->{$mod};
56 }
57 }
143 unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
144 delete $WriteMakefileArgs{TEST_REQUIRES};
145 delete $WriteMakefileArgs{BUILD_REQUIRES};
146 $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
58147 }
59148
60149 delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
61150 unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
62151
63152 WriteMakefile(%WriteMakefileArgs);
64
65
66
+245
-200
README less more
00 NAME
1
12 POE::Component::SSLify - Makes using SSL in the world of POE easy!
23
34 VERSION
4 This document describes v1.008 of POE::Component::SSLify - released May 04, 2011 as part of POE-Component-SSLify.
5
6 This document describes v1.012 of POE::Component::SSLify - released November 14, 2014 as part of POE-Component-SSLify.
57
68 SYNOPSIS
7 # CLIENT-side usage
9
10 # look at the DESCRIPTION for client and server example code
11
12 DESCRIPTION
13
14 This component is a method to simplify the SSLification of a socket
15 before it is passed to a POE::Wheel::ReadWrite wheel in your
16 application.
17
18 Client usage
819
920 # Import the module
1021 use POE::Component::SSLify qw( Client_SSLify );
11
22
1223 # Create a normal SocketFactory wheel and connect to a SSL-enabled server
1324 my $factory = POE::Wheel::SocketFactory->new;
14
25
1526 # Time passes, SocketFactory gives you a socket when it connects in SuccessEvent
1627 # Convert the socket into a SSL socket POE can communicate with
1728 my $socket = shift;
1930 if ( $@ ) {
2031 # Unable to SSLify it...
2132 }
22
33
2334 # Now, hand it off to ReadWrite
2435 my $rw = POE::Wheel::ReadWrite->new(
2536 Handle => $socket,
2637 # other options as usual
2738 );
2839
29 # --------------------------------------------------------------------------- #
30
31 # SERVER-side usage
40 Server usage
3241
3342 # !!! Make sure you have a public key + certificate
3443 # excellent howto: http://www.akadia.com/services/ssh_test_certificate.html
35
44
3645 # Import the module
3746 use POE::Component::SSLify qw( Server_SSLify SSLify_Options );
38
47
3948 # Set the key + certificate file
4049 eval { SSLify_Options( 'server.key', 'server.crt' ) };
4150 if ( $@ ) {
4251 # Unable to load key or certificate file...
4352 }
44
53
4554 # Create a normal SocketFactory wheel to listen for connections
4655 my $factory = POE::Wheel::SocketFactory->new;
47
56
4857 # Time passes, SocketFactory gives you a socket when it gets a connection in SuccessEvent
4958 # Convert the socket into a SSL socket POE can communicate with
5059 my $socket = shift;
5261 if ( $@ ) {
5362 # Unable to SSLify it...
5463 }
55
64
5665 # Now, hand it off to ReadWrite
5766 my $rw = POE::Wheel::ReadWrite->new(
5867 Handle => $socket,
5968 # other options as usual
6069 );
6170
62 DESCRIPTION
63 This component represents the standard way to do SSL in POE.
64
6571 FUNCTIONS
66 Client_SSLify
72
73 Client_SSLify
74
6775 This function sslifies a client-side socket. You can pass several
6876 options to it:
6977
7482 $options is the SSL options you want to use
7583 $ctx is the custom SSL context you want to use
7684 $callback is the callback hook on success/failure of sslification
77
85
7886 # This is an example of the callback and you should pass it as Client_SSLify( $socket, ... , \&callback );
7987 sub callback {
8088 my( $socket, $status, $errval ) = @_;
8290 # $status is either 1 or 0; with 1 signifying success and 0 failure
8391 # $errval will be defined if $status == 0; it's the numeric SSL error code
8492 # check http://www.openssl.org/docs/ssl/SSL_get_error.html for the possible error values ( and import them from Net::SSLeay! )
85
93
8694 # The return value from the callback is discarded
8795 }
8896
89 If $ctx is defined, SSLify will ignore $version and $options. Otherwise,
90 it will be created from the $version and $options parameters. If all of
91 them are undefined, it will follow the defaults in
92 "SSLify_ContextCreate".
97 If $ctx is defined, SSLify will ignore $version and $options.
98 Otherwise, it will be created from the $version and $options
99 parameters. If all of them are undefined, it will follow the defaults
100 in "SSLify_ContextCreate".
93101
94102 BEWARE: If you passed in a CTX, SSLify will do Net::SSLeay::CTX_free(
95103 $ctx ) when the socket is destroyed. This means you cannot reuse
116124 );
117125 return;
118126 }
119
127
120128 # the callback event
121129 sub event_sslify_result {
122130 my ($creation_args, $called_args) = @_[ARG0, ARG1];
123131 my( $socket, $status, $errval ) = @$called_args;
124
132
125133 if ( $status ) {
126134 print "Yay, SSLification worked!";
127135 } else {
129137 }
130138 }
131139
132 Server_SSLify
140 Server_SSLify
141
133142 This function sslifies a server-side socket. You can pass several
134143 options to it:
135144
152161
153162 Please look at "Client_SSLify" for more details on the callback hook.
154163
155 SSLify_ContextCreate
156 Accepts some options, and returns a brand-new Net::SSLeay context object
157 ( $ctx )
164 SSLify_ContextCreate
165
166 Accepts some options, and returns a brand-new Net::SSLeay context
167 object ( $ctx )
158168
159169 my $ctx = SSLify_ContextCreate( $key, $cert, $version, $options );
160170 $key is the certificate key file
169179 By default we don't use the SSL key + certificate files
170180
171181 By default we use the version: default. Known versions of the SSL
172 connection - look at <http://www.openssl.org/docs/ssl/SSL_CTX_new.html>
182 connection - look at http://www.openssl.org/docs/ssl/SSL_CTX_new.html
173183 for more info.
174184
175185 * sslv2
179189 * default ( sslv23 )
180190
181191 By default we don't set any options - look at
182 <http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html> for more
183 info.
184
185 SSLify_Options
192 http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html for more info.
193
194 SSLify_Options
195
186196 Call this function to initialize the global server-side context object.
187197 This will be the default context whenever you call "Server_SSLify"
188198 without passing a custom context to it.
200210 Please look at "SSLify_ContextCreate" for more info on the available
201211 versions/options.
202212
203 SSLify_GetCTX
204 Returns the actual Net::SSLeay context object in case you wanted to play
205 with it :)
213 SSLify_GetCTX
214
215 Returns the actual Net::SSLeay context object in case you wanted to
216 play with it :)
206217
207218 If passed in a socket, it will return that socket's $ctx instead of the
208219 global.
210221 my $ctx = SSLify_GetCTX(); # get the one set via SSLify_Options
211222 my $ctx = SSLify_GetCTX( $sslified_sock ); # get the one in the object
212223
213 SSLify_GetCipher
224 SSLify_GetCipher
225
214226 Returns the cipher used by the SSLified socket
215227
216228 print "SSL Cipher is: " . SSLify_GetCipher( $sslified_sock ) . "\n";
217229
218230 NOTE: Doing this immediately after Client_SSLify or Server_SSLify will
219 result in "(NONE)" because the SSL handshake is not done yet. The socket
220 is nonblocking, so you will have to wait a little bit for it to get
221 ready.
231 result in "(NONE)" because the SSL handshake is not done yet. The
232 socket is nonblocking, so you will have to wait a little bit for it to
233 get ready.
222234
223235 apoc@blackhole:~/mygit/perl-poe-sslify/examples$ perl serverclient.pl
224236 got connection from: 127.0.0.1 - commencing Server_SSLify()
232244 Input: ^C
233245 stopped at serverclient.pl line 126.
234246
235 SSLify_GetSocket
247 SSLify_GetSocket
248
236249 Returns the actual socket used by the SSLified socket, useful for stuff
237250 like getpeername()/getsockname()
238251
239252 print "Remote IP is: " . inet_ntoa( ( unpack_sockaddr_in( getpeername( SSLify_GetSocket( $sslified_sock ) ) ) )[1] ) . "\n";
240253
241 SSLify_GetSSL
254 SSLify_GetSSL
255
242256 Returns the actual Net::SSLeay object so you can call methods on it
243257
244258 print Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $sslified_sock ) );
245259
246 SSLify_GetStatus
260 SSLify_GetStatus
261
247262 Returns the status of the SSL negotiation/handshake/connection. See
248 <http://www.openssl.org/docs/ssl/SSL_connect.html#RETURN_VALUES> for
249 more info.
263 http://www.openssl.org/docs/ssl/SSL_connect.html#RETURN_VALUES for more
264 info.
250265
251266 my $status = SSLify_GetStatus( $socket );
252267 -1 = still in negotiation stage ( or error )
254269 1 = negotiation successful
255270
256271 NOTES
257 Socket methods doesn't work
272
273 Socket methods doesn't work
274
258275 The new socket this module gives you actually is tied socket magic, so
259 you cannot do stuff like getpeername() or getsockname(). The only way to
260 do it is to use "SSLify_GetSocket" and then operate on the socket it
276 you cannot do stuff like getpeername() or getsockname(). The only way
277 to do it is to use "SSLify_GetSocket" and then operate on the socket it
261278 returns.
262279
263 Dying everywhere...
280 Dying everywhere...
281
264282 This module will die() if Net::SSLeay could not be loaded or it is not
265 the version we want. So, it is recommended that you check for errors and
266 not use SSL, like so:
283 the version we want. So, it is recommended that you check for errors
284 and not use SSL, like so:
267285
268286 eval { use POE::Component::SSLify };
269287 if ( $@ ) {
271289 } else {
272290 $sslavailable = 1;
273291 }
274
292
275293 # Make socket SSL!
276294 if ( $sslavailable ) {
277295 eval { $socket = POE::Component::SSLify::Client_SSLify( $socket ) };
280298 }
281299 }
282300
283 $IGNORE_SSL_ERRORS
284 As of SSLify v1.003 you can override this variable to temporarily ignore
285 some SSL errors. This is useful if you are doing crazy things with the
286 underlying Net::SSLeay stuff and don't want to die. However, it won't
287 ignore all errors as some is still considered fatal. Here's an example:
301 $IGNORE_SSL_ERRORS
302
303 As of SSLify v1.003 you can override this variable to temporarily
304 ignore some SSL errors. This is useful if you are doing crazy things
305 with the underlying Net::SSLeay stuff and don't want to die. However,
306 it won't ignore all errors as some is still considered fatal. Here's an
307 example:
288308
289309 {
290310 local $POE::Component::SSLify::IGNORE_SSL_ERRORS=1;
292312 #Some more stuff
293313 }
294314
295 OpenSSL functions
315 OpenSSL functions
316
296317 Theoretically you can do anything that Net::SSLeay exports from the
297318 OpenSSL libs on the socket. However, I have not tested every possible
298319 function against SSLify, so use them carefully!
299320
300 Net::SSLeay::renegotiate
301 This function has been tested ( it's in "t/2_renegotiate_client.t" ) but
302 it doesn't work on FreeBSD! I tracked it down to this security advisory:
303 <http://security.freebsd.org/advisories/FreeBSD-SA-09:15.ssl.asc> which
321 Net::SSLeay::renegotiate
322
323 This function has been tested ( it's in t/2_renegotiate_client.t ) but
324 it doesn't work on FreeBSD! I tracked it down to this security
325 advisory:
326 http://security.freebsd.org/advisories/FreeBSD-SA-09:15.ssl.asc which
304327 explains it in detail. The test will skip this function if it detects
305 that you're on a broken system. However, if you have the updated OpenSSL
306 library that fixes this you can use it.
328 that you're on a broken system. However, if you have the updated
329 OpenSSL library that fixes this you can use it.
307330
308331 NOTE: Calling this means the callback function you passed in
309332 "Client_SSLify" or "Server_SSLify" will not fire! If you need this
310333 please let me know and we can come up with a way to make it work.
311334
312 Upgrading a non-ssl socket to SSL
335 Upgrading a non-ssl socket to SSL
336
313337 You can have a normal plaintext socket, and convert it to SSL anytime.
314 Just keep in mind that the client and the server must agree to sslify at
315 the same time, or they will be waiting on each other forever! See
316 "t/3_upgrade.t" for an example of how this works.
317
318 Downgrading a SSL socket to non-ssl
338 Just keep in mind that the client and the server must agree to sslify
339 at the same time, or they will be waiting on each other forever! See
340 t/3_upgrade.t for an example of how this works.
341
342 Downgrading a SSL socket to non-ssl
343
319344 As of now this is unsupported. If you need this feature please let us
320345 know and we'll work on it together!
321346
322 MSWin32 is not supported
323 This module doesn't work on MSWin32 platforms at all ( XP, Vista, 7, etc
324 ) because of some weird underlying fd issues. Since I'm not a windows
325 developer, I'm unable to fix this. However, it seems like Cygwin on
326 MSWin32 works just fine! Please help me fix this if you can, thanks!
327
328 LOAD_SSL_ENGINES
347 MSWin32 is not supported
348
349 This module doesn't work on MSWin32 platforms at all ( XP, Vista, 7,
350 etc ) because of some weird underlying fd issues. Since I'm not a
351 windows developer, I'm unable to fix this. However, it seems like
352 Cygwin on MSWin32 works just fine! Please help me fix this if you can,
353 thanks!
354
355 LOAD_SSL_ENGINES
356
329357 OpenSSL supports loading ENGINEs to accelerate the crypto algorithms.
330358 SSLify v1.004 automatically loaded the engines, but there was some
331359 problems on certain platforms that caused coredumps. A big shout-out to
336364 use POE::Component::SSLify qw( Client::SSLify );
337365
338366 EXPORT
367
339368 Stuffs all of the functions in @EXPORT_OK so you have to request them
340369 directly.
341370
342371 SEE ALSO
372
343373 Please see those modules/websites for more information related to this
344374 module.
345375
346 * POE
347
348 * Net::SSLeay
376 * POE
377
378 * Net::SSLeay
349379
350380 SUPPORT
351 Perldoc
381
382 Perldoc
383
352384 You can find documentation for this module with the perldoc command.
353385
354386 perldoc POE::Component::SSLify
355387
356 Websites
388 Websites
389
357390 The following websites have more information about this module, and may
358391 be of help to you. As always, in addition to those websites please use
359392 your favorite search engine to discover more resources.
360393
361 * Search CPAN
362
363 The default CPAN search engine, useful to view POD in HTML format.
364
365 <http://search.cpan.org/dist/POE-Component-SSLify>
366
367 * RT: CPAN's Bug Tracker
368
369 The RT ( Request Tracker ) website is the default bug/issue tracking
370 system for CPAN.
371
372 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Component-SSLify>
373
374 * AnnoCPAN
375
376 The AnnoCPAN is a website that allows community annonations of Perl
377 module documentation.
378
379 <http://annocpan.org/dist/POE-Component-SSLify>
380
381 * CPAN Ratings
382
383 The CPAN Ratings is a website that allows community ratings and
384 reviews of Perl modules.
385
386 <http://cpanratings.perl.org/d/POE-Component-SSLify>
387
388 * CPAN Forum
389
390 The CPAN Forum is a web forum for discussing Perl modules.
391
392 <http://cpanforum.com/dist/POE-Component-SSLify>
393
394 * CPANTS
395
396 The CPANTS is a website that analyzes the Kwalitee ( code metrics )
397 of a distribution.
398
399 <http://cpants.perl.org/dist/overview/POE-Component-SSLify>
400
401 * CPAN Testers
402
403 The CPAN Testers is a network of smokers who run automated tests on
404 uploaded CPAN distributions.
405
406 <http://www.cpantesters.org/distro/P/POE-Component-SSLify>
407
408 * CPAN Testers Matrix
409
410 The CPAN Testers Matrix is a website that provides a visual way to
411 determine what Perls/platforms PASSed for a distribution.
412
413 <http://matrix.cpantesters.org/?dist=POE-Component-SSLify>
414
415 * CPAN Testers Dependencies
416
417 The CPAN Testers Dependencies is a website that shows a chart of the
418 test results of all dependencies for a distribution.
419
420 <http://deps.cpantesters.org/?module=POE::Component::SSLify>
421
422 Email
423 You can email the author of this module at "APOCAL at cpan.org" asking
394 * MetaCPAN
395
396 A modern, open-source CPAN search engine, useful to view POD in HTML
397 format.
398
399 http://metacpan.org/release/POE-Component-SSLify
400
401 * Search CPAN
402
403 The default CPAN search engine, useful to view POD in HTML format.
404
405 http://search.cpan.org/dist/POE-Component-SSLify
406
407 * RT: CPAN's Bug Tracker
408
409 The RT ( Request Tracker ) website is the default bug/issue tracking
410 system for CPAN.
411
412 http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Component-SSLify
413
414 * AnnoCPAN
415
416 The AnnoCPAN is a website that allows community annotations of Perl
417 module documentation.
418
419 http://annocpan.org/dist/POE-Component-SSLify
420
421 * CPAN Ratings
422
423 The CPAN Ratings is a website that allows community ratings and
424 reviews of Perl modules.
425
426 http://cpanratings.perl.org/d/POE-Component-SSLify
427
428 * CPAN Forum
429
430 The CPAN Forum is a web forum for discussing Perl modules.
431
432 http://cpanforum.com/dist/POE-Component-SSLify
433
434 * CPANTS
435
436 The CPANTS is a website that analyzes the Kwalitee ( code metrics )
437 of a distribution.
438
439 http://cpants.cpanauthors.org/dist/overview/POE-Component-SSLify
440
441 * CPAN Testers
442
443 The CPAN Testers is a network of smokers who run automated tests on
444 uploaded CPAN distributions.
445
446 http://www.cpantesters.org/distro/P/POE-Component-SSLify
447
448 * CPAN Testers Matrix
449
450 The CPAN Testers Matrix is a website that provides a visual overview
451 of the test results for a distribution on various Perls/platforms.
452
453 http://matrix.cpantesters.org/?dist=POE-Component-SSLify
454
455 * CPAN Testers Dependencies
456
457 The CPAN Testers Dependencies is a website that shows a chart of the
458 test results of all dependencies for a distribution.
459
460 http://deps.cpantesters.org/?module=POE::Component::SSLify
461
462 Email
463
464 You can email the author of this module at APOCAL at cpan.org asking
424465 for help with any problems you have.
425466
426 Internet Relay Chat
427 You can get live help by using IRC ( Internet Relay Chat ). If you don't
428 know what IRC is, please read this excellent guide:
429 <http://en.wikipedia.org/wiki/Internet_Relay_Chat>. Please be courteous
430 and patient when talking to us, as we might be busy or sleeping! You can
431 join those networks/channels and get help:
432
433 * irc.perl.org
434
435 You can connect to the server at 'irc.perl.org' and join this
436 channel: #perl-help then talk to this person for help: Apocalypse.
437
438 * irc.freenode.net
439
440 You can connect to the server at 'irc.freenode.net' and join this
441 channel: #perl then talk to this person for help: Apocal.
442
443 * irc.efnet.org
444
445 You can connect to the server at 'irc.efnet.org' and join this
446 channel: #perl then talk to this person for help: Ap0cal.
447
448 Bugs / Feature Requests
467 Internet Relay Chat
468
469 You can get live help by using IRC ( Internet Relay Chat ). If you
470 don't know what IRC is, please read this excellent guide:
471 http://en.wikipedia.org/wiki/Internet_Relay_Chat. Please be courteous
472 and patient when talking to us, as we might be busy or sleeping! You
473 can join those networks/channels and get help:
474
475 * irc.perl.org
476
477 You can connect to the server at 'irc.perl.org' and join this
478 channel: #perl-help then talk to this person for help: Apocalypse.
479
480 * irc.freenode.net
481
482 You can connect to the server at 'irc.freenode.net' and join this
483 channel: #perl then talk to this person for help: Apocal.
484
485 * irc.efnet.org
486
487 You can connect to the server at 'irc.efnet.org' and join this
488 channel: #perl then talk to this person for help: Ap0cal.
489
490 Bugs / Feature Requests
491
449492 Please report any bugs or feature requests by email to
450 "bug-poe-component-sslify at rt.cpan.org", or through the web interface
451 at
452 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Component-SSLify>.
453 You will be automatically notified of any progress on the request by the
454 system.
455
456 Source Code
493 bug-poe-component-sslify at rt.cpan.org, or through the web interface
494 at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=POE-Component-SSLify.
495 You will be automatically notified of any progress on the request by
496 the system.
497
498 Source Code
499
457500 The code is open to the world, and available for you to hack on. Please
458501 feel free to browse it and play with it, or whatever. If you want to
459502 contribute patches, please send me a diff or prod me to pull from your
460503 repository :)
461504
462 <http://github.com/apocalypse/perl-poe-sslify>
463
464 git clone git://github.com/apocalypse/perl-poe-sslify.git
505 https://github.com/apocalypse/perl-poe-sslify
506
507 git clone https://github.com/apocalypse/perl-poe-sslify.git
465508
466509 AUTHOR
510
467511 Apocalypse <APOCAL@cpan.org>
468512
469513 ACKNOWLEDGEMENTS
514
470515 Original code is entirely Rocco Caputo ( Creator of POE ) -> I simply
471516 packaged up the code into something everyone could use and accepted the burden
472517 of maintaining it :)
473
518
474519 From the PoCo::Client::HTTP code =]
475520 # This code should probably become a POE::Kernel method,
476521 # seeing as it's rather baroque and potentially useful in a number
483528 the changelog for more detail.
484529
485530 COPYRIGHT AND LICENSE
486 This software is copyright (c) 2011 by Apocalypse.
531
532 This software is copyright (c) 2014 by Apocalypse.
487533
488534 This is free software; you can redistribute it and/or modify it under
489535 the same terms as the Perl 5 programming language system itself.
492538 with this distribution.
493539
494540 DISCLAIMER OF WARRANTY
495 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
496 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
497 OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
498 PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
499 EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
500 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
501 ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
502 YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
503 NECESSARY SERVICING, REPAIR, OR CORRECTION.
541
542 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
543 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
544 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
545 WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
546 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
547 PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
548 OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU
549 ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
504550
505551 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
506 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
507 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
508 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
509 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
510 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
511 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
512 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
513 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
514 DAMAGES.
515
552 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
553 CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
554 INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
555 ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
556 NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
557 SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO
558 OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY
559 HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
560
00 This file contains message digests of all files listed in MANIFEST,
1 signed via the Module::Signature module, version 0.66.
1 signed via the Module::Signature module, version 0.73.
22
33 To verify the content in this distribution, first make sure you have
44 Module::Signature installed, then type:
1313 -----BEGIN PGP SIGNED MESSAGE-----
1414 Hash: SHA1
1515
16 SHA1 db814b600c64a9dbf43916f952d61724c9cb5629 Build.PL
17 SHA1 6f3f477a7be6adda1715f4f6232d1c23f1b0c73a Changes
18 SHA1 6a0020176172c6097eb86b34ef42014654df64f3 CommitLog
19 SHA1 e3edc44697d1770c65fec99f6ebdb6ea55fb3050 INSTALL
20 SHA1 263360e99a0de4d587fedefe1a919dcf61af1d10 LICENSE
21 SHA1 3117aae7a178cf1a5ef1c6fbbd9af19a36462dbc MANIFEST
22 SHA1 9dfc07c5655b958e800189837f3ddd37ca050bfe MANIFEST.SKIP
23 SHA1 e248fce45784dc1e74a6632ae73dab4408806755 META.json
24 SHA1 b7979650243be1fb48f457c7f3ad7ec6ee9fd424 META.yml
25 SHA1 88399f5f9ea5f4cff1f2899fde9b6434fa6525fb Makefile.PL
26 SHA1 013286bba5f5a9bdbefd457b13cb150f53c87711 README
16 SHA1 427e6e41b255d709de381b943da559e76480ef19 AUTHOR_PLEDGE
17 SHA1 45bfb1662ceb2f539b7a84e8a83c63ac74e4b112 Build.PL
18 SHA1 b7bce2ca389897293c272733fdddd18e620b7c7d Changes
19 SHA1 a86ef10da1561a868fb7eec3aeb2931f69835fea CommitLog
20 SHA1 b75af39c9fe42eaafb41179a5848d50323b92b6c INSTALL
21 SHA1 e6514e4bc5abd3d1a8c7bd2a782c2f8737b413e7 LICENSE
22 SHA1 751a1dbea35cb81ab2d14f6afa7c5e1013d85379 MANIFEST
23 SHA1 69b8a0accb85effa4bd5f4ea93e4f2386d10ac8b MANIFEST.SKIP
24 SHA1 18ccc7e7ef8eeeb5aae26e3fb6bac1dca6b80533 META.json
25 SHA1 105d53c413f245dff657ba0f36bcbc442ae6b912 META.yml
26 SHA1 f0cd277fa23c2796786f34caab90778c74adec80 Makefile.PL
27 SHA1 02145222e7316163bab8ce9b886b1348f4f380fc README
28 SHA1 d20aeaa271c3d6abe4a55112b6197a0d78b44257 cpanfile
2729 SHA1 41a5da1356107d097f6bbf72c62ee4da83e4119f dist.ini
28 SHA1 96decb1c51052f9b024b6d069e428b4ccc19e909 examples/client.pl
29 SHA1 d8f9b44df461cdcf6cbd7cffd79a9d49aade3947 examples/server.pl
30 SHA1 c4a936c75d1d566e936dfb1776c9a01ea244c618 examples/serverclient.pl
31 SHA1 7c470b55e86d0fc80ca4b60ba3dfb0ab1781591d lib/POE/Component/SSLify.pm
32 SHA1 ee5c6b2eb8109cc96d9f60c2eb993da305f959cf lib/POE/Component/SSLify/ClientHandle.pm
33 SHA1 9ee769ea86ff4ad984bfba8c643e74cc0bcfaaba lib/POE/Component/SSLify/ServerHandle.pm
30 SHA1 9ca4ef12f3325b2fbcd3847a30066bd22fea1acb doap.xml
31 SHA1 7f8e80e0f34831ee62d37236e72d14ff994517f6 examples/client.pl
32 SHA1 e9802b791af652351422884f5899a07bb84ef2ec examples/server.pl
33 SHA1 a7fd612bed4ef287fe7820ce86f56d6a4a8ea43b examples/serverclient.pl
34 SHA1 2f80c76a50a07e5fffaff3c9ace7b9b60f8ac5fd lib/POE/Component/SSLify.pm
35 SHA1 e2bd7e88034f6ec148855d0f65f6a82f88ba9c73 lib/POE/Component/SSLify/ClientHandle.pm
36 SHA1 1c6f932e367fe9b910af853e85a79e850fb27eaa lib/POE/Component/SSLify/ServerHandle.pm
3437 SHA1 59afa28f138a14b956443f915d60a891d5b306b8 mylib/example.crt
3538 SHA1 f2ba02d28cfb207e0a86be7cb4f3c570f257bf93 mylib/example.key
36 SHA1 fd48b12e3df15fb55695e7d1b4ee95dc3c0cd766 t/00-compile.t
37 SHA1 4788d9aa069d03cc4c94ef15e11e8a0e0527561c t/000-report-versions-tiny.t
38 SHA1 9ade9d7296a3511f42ce3010dd7d215630d51c80 t/1_simple.t
39 SHA1 949de479ef156e3845bf64adb21a9556af0420a6 t/2_renegotiate_client.t
40 SHA1 73790060e55b0189540d898a97c485e187f05ae9 t/3_upgrade.t
41 SHA1 3c6e64d27262d54d7b31c2d4f2e65f5d6cab87cf t/4_connect_hook.t
42 SHA1 520cb166745d10fa749372ce686240dafd0da543 t/5_connfail_client.t
43 SHA1 295f221b5001822ac23244030fb1b8be1bd838e8 t/6_connfail_server.t
44 SHA1 156f6b65482911b3be5c8f3ce8c07071c5308d1b t/7_connect_hook_nodata.t
45 SHA1 377a10c6d96cd1a23922526c44c43cd723dafcfd t/8_renegotiate_server.t
46 SHA1 5bb02868a0a8d995272800bc945f6db2669d291e t/98_renegotiate.t
47 SHA1 8f73eec992bcb37639f49945d986ff5a59a1ca36 t/99_mire_test.t
48 SHA1 e3b390873d4de642e25fcfb4b7d16c00b096d24a t/apocalypse.t
39 SHA1 36b0e0fc225ff13e639e9a11671ea67e3179fcd8 t/00-compile.t
40 SHA1 8b29673d89e159edc8a2e01ec6927b6119837b08 t/00-report-prereqs.dd
41 SHA1 0f795aaaadd9edd61eb9ad9933f443802b6f77c3 t/00-report-prereqs.t
42 SHA1 1cf17c9c22e93bf1577f02450a568c61212f03f2 t/00-ssleay-info.t
43 SHA1 17a2d0baef2231e391c26517ee3f919827b9fdfb t/99_mire_test.t
44 SHA1 a42f89f63552797bf82457d864affdb5c74ff000 t/apocalypse.t
45 SHA1 f0488f2a7600b6a56261387f1b2554a859f4bd8f t/connect_hook.t
46 SHA1 b1018a80aec2289255d9620e740335c8cf6355af t/connect_hook_nodata.t
47 SHA1 61c6dc760d6ba8f3c0672cd37c5326796592f340 t/connfail_client.t
48 SHA1 a93284eec5af5e074cabc2499e2151e9f05b2d85 t/connfail_server.t
49 SHA1 6c177f33cdf46a2b9b2e3e348c78566cea7b7fd6 t/renegotiate_client.t
50 SHA1 4382dd4d3340057e840fdf2a2ab65c2d6d1a61b4 t/renegotiate_client_pings.t
51 SHA1 0c29c30bee832d33b4af6b71e5caa812b9e8004c t/renegotiate_server.t
52 SHA1 cdb3bcc592ea5775b06474c82bc3ff58c812c47d t/simple.t
53 SHA1 c88eae9b29402c0f3cc59a4e9e6e9a192f114585 t/simple_large.t
54 SHA1 5db5fb734853185c1b66d98aad41181e071803df t/simple_parallel.t
55 SHA1 2ccf516fbfa01550546426b560bd9009ef947221 t/simple_parallel_large.t
56 SHA1 23dca4da565c773cd934714add8781822771f6fb t/simple_parallel_superbig.t
57 SHA1 45a15084faaa845989f038b8f2e6b4242b570b45 t/simple_superbig.t
58 SHA1 a2983a2e0b87fc1c4d220f5bf52e7bede374f130 t/upgrade.t
4959 -----BEGIN PGP SIGNATURE-----
50 Version: GnuPG v1.4.9 (GNU/Linux)
60 Version: GnuPG v1
5161
52 iEYEARECAAYFAk3By1oACgkQGfr7vsGKgxx47ACfTzDqglDL4xb266x3RMOBG3AJ
53 xj0AoNyF1h2KqHOYNVVImQmGy6UIw8D5
54 =qxVp
62 iEYEARECAAYFAlRmY/EACgkQGfr7vsGKgxwVbwCg1jqDFkbib8f3MCrMsCVrqB1E
63 fFcAoL/1YQl9RjHzzm9Jizzs2Sc5zgbd
64 =KGeN
5565 -----END PGP SIGNATURE-----
0 requires "Exporter" => "0";
1 requires "IO::Handle" => "1.28";
2 requires "Net::SSLeay" => "1.36";
3 requires "POE" => "1.267";
4 requires "Scalar::Util" => "0";
5 requires "Symbol" => "0";
6 requires "Task::Weaken" => "1.03";
7 requires "parent" => "0";
8 requires "perl" => "5.006";
9 requires "strict" => "0";
10 requires "warnings" => "0";
11
12 on 'test' => sub {
13 requires "ExtUtils::MakeMaker" => "0";
14 requires "File::Spec" => "0";
15 requires "File::Temp" => "0";
16 requires "IO::Handle" => "1.28";
17 requires "IPC::Open3" => "0";
18 requires "POE" => "1.267";
19 requires "POE::Component::Client::TCP" => "0";
20 requires "POE::Component::Server::TCP" => "0";
21 requires "POE::Filter::Stream" => "0";
22 requires "Socket" => "0";
23 requires "Test::FailWarnings" => "0";
24 requires "Test::More" => "1.001002";
25 requires "perl" => "5.006";
26 };
27
28 on 'test' => sub {
29 recommends "CPAN::Meta" => "2.120900";
30 };
31
32 on 'configure' => sub {
33 requires "ExtUtils::MakeMaker" => "0";
34 requires "Module::Build::Tiny" => "0.039";
35 requires "perl" => "5.006";
36 };
0 <?xml version="1.0" encoding="UTF-8" ?>
1 <Project
2 xmlns="http://usefulinc.com/ns/doap#"
3 xmlns:dc="http://purl.org/dc/terms/"
4 xmlns:foaf="http://xmlns.com/foaf/0.1/"
5 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
6 xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
7 >
8 <name>POE-Component-SSLify</name>
9 <shortdesc>Makes using SSL in the world of POE easy!</shortdesc>
10 <developer>
11 <foaf:Person>
12 <foaf:name>Apocalypse</foaf:name>
13 <foaf:mbox rdf:resource="mailto:APOCAL@cpan.org" />
14 </foaf:Person>
15 </developer>
16 <license rdf:resource="http://dev.perl.org/licenses/" />
17 <homepage rdf:resource="https://github.com/apocalypse/perl-poe-sslify" />
18 <bug-database rdf:resource="http://rt.cpan.org/Public/Dist/Display.html?Name=POE-Component-SSLify" />
19 <repository>
20 <GitRepository>
21 <browse rdf:resource="https://github.com/apocalypse/perl-poe-sslify" />
22 <location rdf:resource="https://github.com/apocalypse/perl-poe-sslify.git" />
23 </GitRepository>
24 </repository>
25 <programming-language>Perl</programming-language>
26 </Project>
11 #
22 # This file is part of POE-Component-SSLify
33 #
4 # This software is copyright (c) 2011 by Apocalypse.
4 # This software is copyright (c) 2014 by Apocalypse.
55 #
66 # This is free software; you can redistribute it and/or modify it under
77 # the same terms as the Perl 5 programming language system itself.
11 #
22 # This file is part of POE-Component-SSLify
33 #
4 # This software is copyright (c) 2011 by Apocalypse.
4 # This software is copyright (c) 2014 by Apocalypse.
55 #
66 # This is free software; you can redistribute it and/or modify it under
77 # the same terms as the Perl 5 programming language system itself.
11 #
22 # This file is part of POE-Component-SSLify
33 #
4 # This software is copyright (c) 2011 by Apocalypse.
4 # This software is copyright (c) 2014 by Apocalypse.
55 #
66 # This is free software; you can redistribute it and/or modify it under
77 # the same terms as the Perl 5 programming language system itself.
00 #
11 # This file is part of POE-Component-SSLify
22 #
3 # This software is copyright (c) 2011 by Apocalypse.
3 # This software is copyright (c) 2014 by Apocalypse.
44 #
55 # This is free software; you can redistribute it and/or modify it under
66 # the same terms as the Perl 5 programming language system itself.
77 #
88 use strict; use warnings;
99 package POE::Component::SSLify::ClientHandle;
10 BEGIN {
11 $POE::Component::SSLify::ClientHandle::VERSION = '1.008';
12 }
13 BEGIN {
14 $POE::Component::SSLify::ClientHandle::AUTHORITY = 'cpan:APOCAL';
15 }
10 $POE::Component::SSLify::ClientHandle::VERSION = '1.012';
11 our $AUTHORITY = 'cpan:APOCAL';
1612
1713 # ABSTRACT: Client-side handle for SSLify
1814
5854
5955 1;
6056
57 __END__
6158
62 __END__
6359 =pod
6460
61 =encoding UTF-8
62
6563 =for :stopwords Apocalypse
66
67 =encoding utf-8
6864
6965 =head1 NAME
7066
7268
7369 =head1 VERSION
7470
75 This document describes v1.008 of POE::Component::SSLify::ClientHandle - released May 04, 2011 as part of POE-Component-SSLify.
71 This document describes v1.012 of POE::Component::SSLify::ClientHandle - released November 14, 2014 as part of POE-Component-SSLify.
7672
7773 =head1 DESCRIPTION
7874
10096
10197 =head1 COPYRIGHT AND LICENSE
10298
103 This software is copyright (c) 2011 by Apocalypse.
99 This software is copyright (c) 2014 by Apocalypse.
104100
105101 This is free software; you can redistribute it and/or modify it under
106102 the same terms as the Perl 5 programming language system itself.
107103
108 The full text of the license can be found in the LICENSE file included with this distribution.
104 The full text of the license can be found in the
105 F<LICENSE> file included with this distribution.
109106
110107 =head1 DISCLAIMER OF WARRANTY
111108
112 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
113 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
114 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
115 PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
116 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
117 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
118 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
119 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME
120 THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
109 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
110 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
111 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
112 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
113 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
114 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
115 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
116 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
121117
122118 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
123 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
124 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
125 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
126 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
127 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
128 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
129 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
130 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
131 DAMAGES.
119 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
120 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
121 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
122 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
123 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
124 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
125 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
126 SUCH DAMAGES.
132127
133128 =cut
134
00 #
11 # This file is part of POE-Component-SSLify
22 #
3 # This software is copyright (c) 2011 by Apocalypse.
3 # This software is copyright (c) 2014 by Apocalypse.
44 #
55 # This is free software; you can redistribute it and/or modify it under
66 # the same terms as the Perl 5 programming language system itself.
77 #
88 use strict; use warnings;
99 package POE::Component::SSLify::ServerHandle;
10 BEGIN {
11 $POE::Component::SSLify::ServerHandle::VERSION = '1.008';
12 }
13 BEGIN {
14 $POE::Component::SSLify::ServerHandle::AUTHORITY = 'cpan:APOCAL';
15 }
10 $POE::Component::SSLify::ServerHandle::VERSION = '1.012';
11 our $AUTHORITY = 'cpan:APOCAL';
1612
1713 # ABSTRACT: Server-side handle for SSLify
1814
156152 # Write some stuff to the socket
157153 sub WRITE {
158154 # Get ourself + buffer + length + offset to write
159 my( $self, $buf, $len, $offset ) = @_;
155 my( $self, $len, $offset ) = ( $_[0], $_[2], $_[3] );
156 my $buf = \$_[1]; # don't copy!
160157
161158 # Check the status of the SSL handshake
162159 if ( ! $self->{'ssl_started'} ) {
169166 $offset = 0;
170167 }
171168
172 # We count the number of characters written to the socket
173 my $wrote_len = Net::SSLeay::write( $self->{'ssl'}, substr( $buf, $offset, $len ) );
169 # Thanks to RT#95071 and RT#58243 we need to clamp the length to the TLS 16K limit
170 # seems like the same thing happened to https://www.mail-archive.com/openssl-users@openssl.org/msg28151.html
171 $len = 16_384 if $len > 16_384;
172
173 # don't trigger substr's magic as it is SLOOOOOOOOW!
174 # see http://www.perlmonks.org/?node_id=732873
175 my $wrote_len = Net::SSLeay::write( $self->{'ssl'}, scalar substr( $$buf, $offset, $len ) );
174176
175177 # Did we get an error or number of bytes written?
176178 # Net::SSLeay::write() returns the number of bytes written, or 0 on unsuccessful
260262
261263 1;
262264
263
264265 __END__
266
265267 =pod
266268
269 =encoding UTF-8
270
267271 =for :stopwords Apocalypse
268272
269 =encoding utf-8
270
271273 =head1 NAME
272274
273275 POE::Component::SSLify::ServerHandle - Server-side handle for SSLify
274276
275277 =head1 VERSION
276278
277 This document describes v1.008 of POE::Component::SSLify::ServerHandle - released May 04, 2011 as part of POE-Component-SSLify.
279 This document describes v1.012 of POE::Component::SSLify::ServerHandle - released November 14, 2014 as part of POE-Component-SSLify.
278280
279281 =head1 DESCRIPTION
280282
306308
307309 =head1 COPYRIGHT AND LICENSE
308310
309 This software is copyright (c) 2011 by Apocalypse.
311 This software is copyright (c) 2014 by Apocalypse.
310312
311313 This is free software; you can redistribute it and/or modify it under
312314 the same terms as the Perl 5 programming language system itself.
313315
314 The full text of the license can be found in the LICENSE file included with this distribution.
316 The full text of the license can be found in the
317 F<LICENSE> file included with this distribution.
315318
316319 =head1 DISCLAIMER OF WARRANTY
317320
318 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
319 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
320 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
321 PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
322 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
323 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
324 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
325 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME
326 THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
321 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
322 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
323 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
324 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
325 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
326 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
327 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
328 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
327329
328330 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
329 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
330 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
331 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
332 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
333 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
334 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
335 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
336 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
337 DAMAGES.
331 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
332 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
333 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
334 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
335 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
336 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
337 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
338 SUCH DAMAGES.
338339
339340 =cut
340
00 #
11 # This file is part of POE-Component-SSLify
22 #
3 # This software is copyright (c) 2011 by Apocalypse.
3 # This software is copyright (c) 2014 by Apocalypse.
44 #
55 # This is free software; you can redistribute it and/or modify it under
66 # the same terms as the Perl 5 programming language system itself.
77 #
88 use strict; use warnings;
99 package POE::Component::SSLify;
10 BEGIN {
11 $POE::Component::SSLify::VERSION = '1.008';
12 }
13 BEGIN {
14 $POE::Component::SSLify::AUTHORITY = 'cpan:APOCAL';
15 }
10 # git description: release-1.011-1-g57b6383
11 $POE::Component::SSLify::VERSION = '1.012';
12 our $AUTHORITY = 'cpan:APOCAL';
1613
1714 # ABSTRACT: Makes using SSL in the world of POE easy!
1815
109106 # global so users of this module can override it locally
110107 our $IGNORE_SSL_ERRORS = 0;
111108
109 #pod =func Client_SSLify
110 #pod
111 #pod This function sslifies a client-side socket. You can pass several options to it:
112 #pod
113 #pod my $socket = shift;
114 #pod $socket = Client_SSLify( $socket, $version, $options, $ctx, $callback );
115 #pod $socket is the non-ssl socket you got from somewhere ( required )
116 #pod $version is the SSL version you want to use
117 #pod $options is the SSL options you want to use
118 #pod $ctx is the custom SSL context you want to use
119 #pod $callback is the callback hook on success/failure of sslification
120 #pod
121 #pod # This is an example of the callback and you should pass it as Client_SSLify( $socket, ... , \&callback );
122 #pod sub callback {
123 #pod my( $socket, $status, $errval ) = @_;
124 #pod # $socket is the original sslified socket in case you need to play with it
125 #pod # $status is either 1 or 0; with 1 signifying success and 0 failure
126 #pod # $errval will be defined if $status == 0; it's the numeric SSL error code
127 #pod # check http://www.openssl.org/docs/ssl/SSL_get_error.html for the possible error values ( and import them from Net::SSLeay! )
128 #pod
129 #pod # The return value from the callback is discarded
130 #pod }
131 #pod
132 #pod If $ctx is defined, SSLify will ignore $version and $options. Otherwise, it will be created from the $version and
133 #pod $options parameters. If all of them are undefined, it will follow the defaults in L</SSLify_ContextCreate>.
134 #pod
135 #pod BEWARE: If you passed in a CTX, SSLify will do Net::SSLeay::CTX_free( $ctx ) when the
136 #pod socket is destroyed. This means you cannot reuse contexts!
137 #pod
138 #pod NOTE: The way to have a client socket with proper certificates set up is:
139 #pod
140 #pod my $socket = shift; # get the socket from somewhere
141 #pod my $ctx = SSLify_ContextCreate( 'server.key', 'server.crt' );
142 #pod $socket = Client_SSLify( $socket, undef, undef, $ctx );
143 #pod
144 #pod NOTE: You can pass the callback anywhere in the arguments, we'll figure it out for you! If you want to call a POE event, please look
145 #pod into the postback/callback stuff in L<POE::Session>.
146 #pod
147 #pod # we got this from POE::Wheel::SocketFactory
148 #pod sub event_SuccessEvent {
149 #pod my $socket = $_[ARG0];
150 #pod $socket = Client_SSLify( $socket, $_[SESSION]->callback( 'sslify_result' ) );
151 #pod $_[HEAP]->{client} = POE::Wheel::ReadWrite->new(
152 #pod Handle => $socket,
153 #pod ...
154 #pod );
155 #pod return;
156 #pod }
157 #pod
158 #pod # the callback event
159 #pod sub event_sslify_result {
160 #pod my ($creation_args, $called_args) = @_[ARG0, ARG1];
161 #pod my( $socket, $status, $errval ) = @$called_args;
162 #pod
163 #pod if ( $status ) {
164 #pod print "Yay, SSLification worked!";
165 #pod } else {
166 #pod print "Aw, SSLification failed with error $errval";
167 #pod }
168 #pod }
169 #pod =cut
112170
113171 sub Client_SSLify {
114172 # Get the socket + version + options + ctx + callback
151209 return $newsock;
152210 }
153211
212 #pod =func Server_SSLify
213 #pod
214 #pod This function sslifies a server-side socket. You can pass several options to it:
215 #pod
216 #pod my $socket = shift;
217 #pod $socket = Server_SSLify( $socket, $ctx, $callback );
218 #pod $socket is the non-ssl socket you got from somewhere ( required )
219 #pod $ctx is the custom SSL context you want to use; overrides the global ctx set in SSLify_Options
220 #pod $callback is the callback hook on success/failure of sslification
221 #pod
222 #pod BEWARE: L</SSLify_Options> must be called first if you aren't passing a $ctx. If you want to set some options per-connection, do this:
223 #pod
224 #pod my $socket = shift; # get the socket from somewhere
225 #pod my $ctx = SSLify_ContextCreate();
226 #pod # set various options on $ctx as desired
227 #pod $socket = Server_SSLify( $socket, $ctx );
228 #pod
229 #pod NOTE: You can use L</SSLify_GetCTX> to modify the global, and avoid doing this on every connection if the
230 #pod options are the same...
231 #pod
232 #pod Please look at L</Client_SSLify> for more details on the callback hook.
233 #pod =cut
154234
155235 sub Server_SSLify {
156236 # Get the socket!
192272 return $newsock;
193273 }
194274
275 #pod =func SSLify_ContextCreate
276 #pod
277 #pod Accepts some options, and returns a brand-new Net::SSLeay context object ( $ctx )
278 #pod
279 #pod my $ctx = SSLify_ContextCreate( $key, $cert, $version, $options );
280 #pod $key is the certificate key file
281 #pod $cert is the certificate file
282 #pod $version is the SSL version to use
283 #pod $options is the SSL options to use
284 #pod
285 #pod You can then call various Net::SSLeay methods on the context
286 #pod
287 #pod my $mode = Net::SSLeay::CTX_get_mode( $ctx );
288 #pod
289 #pod By default we don't use the SSL key + certificate files
290 #pod
291 #pod By default we use the version: default. Known versions of the SSL connection - look at
292 #pod L<http://www.openssl.org/docs/ssl/SSL_CTX_new.html> for more info.
293 #pod
294 #pod * sslv2
295 #pod * sslv3
296 #pod * tlsv1
297 #pod * sslv23
298 #pod * default ( sslv23 )
299 #pod
300 #pod By default we don't set any options - look at L<http://www.openssl.org/docs/ssl/SSL_CTX_set_options.html> for more info.
301 #pod =cut
195302
196303 sub SSLify_ContextCreate {
197304 # Get the key + cert + version + options
200307 return _createSSLcontext( $key, $cert, $version, $options );
201308 }
202309
310 #pod =func SSLify_Options
311 #pod
312 #pod Call this function to initialize the global server-side context object. This will be the default context whenever you call
313 #pod L</Server_SSLify> without passing a custom context to it.
314 #pod
315 #pod SSLify_Options( $key, $cert, $version, $options );
316 #pod $key is the certificate key file ( required )
317 #pod $cert is the certificate file ( required )
318 #pod $version is the SSL version to use
319 #pod $options is the SSL options to use
320 #pod
321 #pod By default we use the version: default
322 #pod
323 #pod By default we use the options: Net::SSLeay::OP_ALL
324 #pod
325 #pod Please look at L</SSLify_ContextCreate> for more info on the available versions/options.
326 #pod =cut
203327
204328 sub SSLify_Options {
205329 # Get the key + cert + version + options
275399 return $context;
276400 }
277401
402 #pod =func SSLify_GetCTX
403 #pod
404 #pod Returns the actual Net::SSLeay context object in case you wanted to play with it :)
405 #pod
406 #pod If passed in a socket, it will return that socket's $ctx instead of the global.
407 #pod
408 #pod my $ctx = SSLify_GetCTX(); # get the one set via SSLify_Options
409 #pod my $ctx = SSLify_GetCTX( $sslified_sock ); # get the one in the object
410 #pod =cut
278411
279412 sub SSLify_GetCTX {
280413 my $sock = shift;
285418 }
286419 }
287420
421 #pod =func SSLify_GetCipher
422 #pod
423 #pod Returns the cipher used by the SSLified socket
424 #pod
425 #pod print "SSL Cipher is: " . SSLify_GetCipher( $sslified_sock ) . "\n";
426 #pod
427 #pod NOTE: Doing this immediately after Client_SSLify or Server_SSLify will result in "(NONE)" because the SSL handshake
428 #pod is not done yet. The socket is nonblocking, so you will have to wait a little bit for it to get ready.
429 #pod
430 #pod apoc@blackhole:~/mygit/perl-poe-sslify/examples$ perl serverclient.pl
431 #pod got connection from: 127.0.0.1 - commencing Server_SSLify()
432 #pod SSLified: 127.0.0.1 cipher type: ((NONE))
433 #pod Connected to server, commencing Client_SSLify()
434 #pod SSLified the connection to the server
435 #pod Connected to SSL server
436 #pod Input: hola
437 #pod got input from: 127.0.0.1 cipher type: (AES256-SHA) input: 'hola'
438 #pod Got Reply: hola
439 #pod Input: ^C
440 #pod stopped at serverclient.pl line 126.
441 #pod =cut
288442
289443 sub SSLify_GetCipher {
290444 my $sock = shift;
291445 return Net::SSLeay::get_cipher( tied( *$sock )->{'ssl'} );
292446 }
293447
448 #pod =func SSLify_GetSocket
449 #pod
450 #pod Returns the actual socket used by the SSLified socket, useful for stuff like getpeername()/getsockname()
451 #pod
452 #pod print "Remote IP is: " . inet_ntoa( ( unpack_sockaddr_in( getpeername( SSLify_GetSocket( $sslified_sock ) ) ) )[1] ) . "\n";
453 #pod =cut
294454
295455 sub SSLify_GetSocket {
296456 my $sock = shift;
297457 return tied( *$sock )->{'socket'};
298458 }
299459
460 #pod =func SSLify_GetSSL
461 #pod
462 #pod Returns the actual Net::SSLeay object so you can call methods on it
463 #pod
464 #pod print Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $sslified_sock ) );
465 #pod =cut
300466
301467 sub SSLify_GetSSL {
302468 my $sock = shift;
303469 return tied( *$sock )->{'ssl'};
304470 }
305471
472 #pod =func SSLify_GetStatus
473 #pod
474 #pod Returns the status of the SSL negotiation/handshake/connection. See L<http://www.openssl.org/docs/ssl/SSL_connect.html#RETURN_VALUES>
475 #pod for more info.
476 #pod
477 #pod my $status = SSLify_GetStatus( $socket );
478 #pod -1 = still in negotiation stage ( or error )
479 #pod 0 = internal SSL error, connection will be dead
480 #pod 1 = negotiation successful
481 #pod =cut
306482
307483 sub SSLify_GetStatus {
308484 my $sock = shift;
311487
312488 1;
313489
314
315490 __END__
491
316492 =pod
317493
494 =encoding UTF-8
495
318496 =for :stopwords Apocalypse cpan testmatrix url annocpan anno bugtracker rt cpants kwalitee
319 diff irc mailto metadata placeholders
320
321 =encoding utf-8
497 diff irc mailto metadata placeholders metacpan
322498
323499 =head1 NAME
324500
326502
327503 =head1 VERSION
328504
329 This document describes v1.008 of POE::Component::SSLify - released May 04, 2011 as part of POE-Component-SSLify.
505 This document describes v1.012 of POE::Component::SSLify - released November 14, 2014 as part of POE-Component-SSLify.
330506
331507 =head1 SYNOPSIS
332508
333 # CLIENT-side usage
509 # look at the DESCRIPTION for client and server example code
510
511 =head1 DESCRIPTION
512
513 This component is a method to simplify the SSLification of a socket before it is passed
514 to a L<POE::Wheel::ReadWrite> wheel in your application.
515
516 =head2 Client usage
334517
335518 # Import the module
336519 use POE::Component::SSLify qw( Client_SSLify );
352535 # other options as usual
353536 );
354537
355 # --------------------------------------------------------------------------- #
356
357 # SERVER-side usage
538 =head2 Server usage
358539
359540 # !!! Make sure you have a public key + certificate
360541 # excellent howto: http://www.akadia.com/services/ssh_test_certificate.html
384565 Handle => $socket,
385566 # other options as usual
386567 );
387
388 =head1 DESCRIPTION
389
390 This component represents the standard way to do SSL in POE.
391568
392569 =head1 FUNCTIONS
393570
684861
685862 =item *
686863
864 MetaCPAN
865
866 A modern, open-source CPAN search engine, useful to view POD in HTML format.
867
868 L<http://metacpan.org/release/POE-Component-SSLify>
869
870 =item *
871
687872 Search CPAN
688873
689874 The default CPAN search engine, useful to view POD in HTML format.
702887
703888 AnnoCPAN
704889
705 The AnnoCPAN is a website that allows community annonations of Perl module documentation.
890 The AnnoCPAN is a website that allows community annotations of Perl module documentation.
706891
707892 L<http://annocpan.org/dist/POE-Component-SSLify>
708893
728913
729914 The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
730915
731 L<http://cpants.perl.org/dist/overview/POE-Component-SSLify>
916 L<http://cpants.cpanauthors.org/dist/overview/POE-Component-SSLify>
732917
733918 =item *
734919
742927
743928 CPAN Testers Matrix
744929
745 The CPAN Testers Matrix is a website that provides a visual way to determine what Perls/platforms PASSed for a distribution.
930 The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
746931
747932 L<http://matrix.cpantesters.org/?dist=POE-Component-SSLify>
748933
801986 with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull
802987 from your repository :)
803988
804 L<http://github.com/apocalypse/perl-poe-sslify>
805
806 git clone git://github.com/apocalypse/perl-poe-sslify.git
989 L<https://github.com/apocalypse/perl-poe-sslify>
990
991 git clone https://github.com/apocalypse/perl-poe-sslify.git
807992
808993 =head1 AUTHOR
809994
8171002
8181003 From the PoCo::Client::HTTP code =]
8191004 # This code should probably become a POE::Kernel method,
820 # seeing as it's rather baroque and potentially useful in a number
821 # of places.
1005 # seeing as it's rather baroque and potentially useful in a number
1006 # of places.
8221007
8231008 ASCENT also helped a lot with the nonblocking mode, without his hard work this
8241009 module would still be stuck in the stone age :)
8271012
8281013 =head1 COPYRIGHT AND LICENSE
8291014
830 This software is copyright (c) 2011 by Apocalypse.
1015 This software is copyright (c) 2014 by Apocalypse.
8311016
8321017 This is free software; you can redistribute it and/or modify it under
8331018 the same terms as the Perl 5 programming language system itself.
8341019
835 The full text of the license can be found in the LICENSE file included with this distribution.
1020 The full text of the license can be found in the
1021 F<LICENSE> file included with this distribution.
8361022
8371023 =head1 DISCLAIMER OF WARRANTY
8381024
839 BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
840 FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
841 WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
842 PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
843 EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
844 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
845 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
846 SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME
847 THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
1025 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
1026 APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
1027 HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
1028 OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
1029 THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1030 PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
1031 IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
1032 ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
8481033
8491034 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
850 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
851 REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
852 TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
853 CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
854 SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
855 RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
856 FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
857 SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
858 DAMAGES.
1035 WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
1036 THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
1037 GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
1038 USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
1039 DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
1040 PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
1041 EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
1042 SUCH DAMAGES.
8591043
8601044 =cut
861
0 #!perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10
0 use 5.006;
111 use strict;
122 use warnings;
133
4 # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.051
5
146 use Test::More;
7
8 plan tests => 3 + ($ENV{AUTHOR_TESTING} ? 1 : 0);
9
10 my @module_files = (
11 'POE/Component/SSLify.pm',
12 'POE/Component/SSLify/ClientHandle.pm',
13 'POE/Component/SSLify/ServerHandle.pm'
14 );
1515
1616
1717
18 use File::Find;
19 use File::Temp qw{ tempdir };
18 # fake home for cpan-testers
19 use File::Temp;
20 local $ENV{HOME} = File::Temp::tempdir( CLEANUP => 1 );
2021
21 my @modules;
22 find(
23 sub {
24 return if $File::Find::name !~ /\.pm\z/;
25 my $found = $File::Find::name;
26 $found =~ s{^lib/}{};
27 $found =~ s{[/\\]}{::}g;
28 $found =~ s/\.pm$//;
29 # nothing to skip
30 push @modules, $found;
31 },
32 'lib',
33 );
3422
35 my @scripts = glob "bin/*";
23 my $inc_switch = -d 'blib' ? '-Mblib' : '-Ilib';
3624
37 my $plan = scalar(@modules) + scalar(@scripts);
38 $plan ? (plan tests => $plan) : (plan skip_all => "no tests to run");
25 use File::Spec;
26 use IPC::Open3;
27 use IO::Handle;
3928
29 open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";
30
31 my @warnings;
32 for my $lib (@module_files)
4033 {
41 # fake home for cpan-testers
42 local $ENV{HOME} = tempdir( CLEANUP => 1 );
34 # see L<perlfaq8/How can I capture STDERR from an external command?>
35 my $stderr = IO::Handle->new;
4336
44 like( qx{ $^X -Ilib -e "require $_; print '$_ ok'" }, qr/^\s*$_ ok/s, "$_ loaded ok" )
45 for sort @modules;
37 my $pid = open3($stdin, '>&STDERR', $stderr, $^X, $inc_switch, '-e', "require q[$lib]");
38 binmode $stderr, ':crlf' if $^O eq 'MSWin32';
39 my @_warnings = <$stderr>;
40 waitpid($pid, 0);
41 is($?, 0, "$lib loaded ok");
4642
47 SKIP: {
48 eval "use Test::Script 1.05; 1;";
49 skip "Test::Script needed to test script compilation", scalar(@scripts) if $@;
50 foreach my $file ( @scripts ) {
51 my $script = $file;
52 $script =~ s!.*/!!;
53 script_compiles( $file, "$script script compiles" );
54 }
43 if (@_warnings)
44 {
45 warn @_warnings;
46 push @warnings, @_warnings;
5547 }
5648 }
49
50
51
52 is(scalar(@warnings), 0, 'no warnings found')
53 or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING};
54
55
0 do { my $x = {
1 'configure' => {
2 'requires' => {
3 'ExtUtils::MakeMaker' => '0',
4 'Module::Build::Tiny' => '0.039',
5 'perl' => '5.006'
6 }
7 },
8 'runtime' => {
9 'requires' => {
10 'Exporter' => '0',
11 'IO::Handle' => '1.28',
12 'Net::SSLeay' => '1.36',
13 'POE' => '1.267',
14 'Scalar::Util' => '0',
15 'Symbol' => '0',
16 'Task::Weaken' => '1.03',
17 'parent' => '0',
18 'perl' => '5.006',
19 'strict' => '0',
20 'warnings' => '0'
21 }
22 },
23 'test' => {
24 'recommends' => {
25 'CPAN::Meta' => '2.120900'
26 },
27 'requires' => {
28 'ExtUtils::MakeMaker' => '0',
29 'File::Spec' => '0',
30 'File::Temp' => '0',
31 'IO::Handle' => '1.28',
32 'IPC::Open3' => '0',
33 'POE' => '1.267',
34 'POE::Component::Client::TCP' => '0',
35 'POE::Component::Server::TCP' => '0',
36 'POE::Filter::Stream' => '0',
37 'Socket' => '0',
38 'Test::FailWarnings' => '0',
39 'Test::More' => '1.001002',
40 'perl' => '5.006'
41 }
42 }
43 };
44 $x;
45 }
0 #!perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10
11 use strict;
12 use warnings;
13
14 # This test was generated by Dist::Zilla::Plugin::Test::ReportPrereqs 0.019
15
16 use Test::More tests => 1;
17
18 use ExtUtils::MakeMaker;
19 use File::Spec;
20
21 # from $version::LAX
22 my $lax_version_re =
23 qr/(?: undef | (?: (?:[0-9]+) (?: \. | (?:\.[0-9]+) (?:_[0-9]+)? )?
24 |
25 (?:\.[0-9]+) (?:_[0-9]+)?
26 ) | (?:
27 v (?:[0-9]+) (?: (?:\.[0-9]+)+ (?:_[0-9]+)? )?
28 |
29 (?:[0-9]+)? (?:\.[0-9]+){2,} (?:_[0-9]+)?
30 )
31 )/x;
32
33 # hide optional CPAN::Meta modules from prereq scanner
34 # and check if they are available
35 my $cpan_meta = "CPAN::Meta";
36 my $cpan_meta_pre = "CPAN::Meta::Prereqs";
37 my $HAS_CPAN_META = eval "require $cpan_meta; $cpan_meta->VERSION('2.120900')" && eval "require $cpan_meta_pre"; ## no critic
38
39 # Verify requirements?
40 my $DO_VERIFY_PREREQS = 1;
41
42 sub _max {
43 my $max = shift;
44 $max = ( $_ > $max ) ? $_ : $max for @_;
45 return $max;
46 }
47
48 sub _merge_prereqs {
49 my ($collector, $prereqs) = @_;
50
51 # CPAN::Meta::Prereqs object
52 if (ref $collector eq $cpan_meta_pre) {
53 return $collector->with_merged_prereqs(
54 CPAN::Meta::Prereqs->new( $prereqs )
55 );
56 }
57
58 # Raw hashrefs
59 for my $phase ( keys %$prereqs ) {
60 for my $type ( keys %{ $prereqs->{$phase} } ) {
61 for my $module ( keys %{ $prereqs->{$phase}{$type} } ) {
62 $collector->{$phase}{$type}{$module} = $prereqs->{$phase}{$type}{$module};
63 }
64 }
65 }
66
67 return $collector;
68 }
69
70 my @include = qw(
71
72 );
73
74 my @exclude = qw(
75
76 );
77
78 # Add static prereqs to the included modules list
79 my $static_prereqs = do 't/00-report-prereqs.dd';
80
81 # Merge all prereqs (either with ::Prereqs or a hashref)
82 my $full_prereqs = _merge_prereqs(
83 ( $HAS_CPAN_META ? $cpan_meta_pre->new : {} ),
84 $static_prereqs
85 );
86
87 # Add dynamic prereqs to the included modules list (if we can)
88 my ($source) = grep { -f } 'MYMETA.json', 'MYMETA.yml';
89 if ( $source && $HAS_CPAN_META ) {
90 if ( my $meta = eval { CPAN::Meta->load_file($source) } ) {
91 $full_prereqs = _merge_prereqs($full_prereqs, $meta->prereqs);
92 }
93 }
94 else {
95 $source = 'static metadata';
96 }
97
98 my @full_reports;
99 my @dep_errors;
100 my $req_hash = $HAS_CPAN_META ? $full_prereqs->as_string_hash : $full_prereqs;
101
102 # Add static includes into a fake section
103 for my $mod (@include) {
104 $req_hash->{other}{modules}{$mod} = 0;
105 }
106
107 for my $phase ( qw(configure build test runtime develop other) ) {
108 next unless $req_hash->{$phase};
109 next if ($phase eq 'develop' and not $ENV{AUTHOR_TESTING});
110
111 for my $type ( qw(requires recommends suggests conflicts modules) ) {
112 next unless $req_hash->{$phase}{$type};
113
114 my $title = ucfirst($phase).' '.ucfirst($type);
115 my @reports = [qw/Module Want Have/];
116
117 for my $mod ( sort keys %{ $req_hash->{$phase}{$type} } ) {
118 next if $mod eq 'perl';
119 next if grep { $_ eq $mod } @exclude;
120
121 my $file = $mod;
122 $file =~ s{::}{/}g;
123 $file .= ".pm";
124 my ($prefix) = grep { -e File::Spec->catfile($_, $file) } @INC;
125
126 my $want = $req_hash->{$phase}{$type}{$mod};
127 $want = "undef" unless defined $want;
128 $want = "any" if !$want && $want == 0;
129
130 my $req_string = $want eq 'any' ? 'any version required' : "version '$want' required";
131
132 if ($prefix) {
133 my $have = MM->parse_version( File::Spec->catfile($prefix, $file) );
134 $have = "undef" unless defined $have;
135 push @reports, [$mod, $want, $have];
136
137 if ( $DO_VERIFY_PREREQS && $HAS_CPAN_META && $type eq 'requires' ) {
138 if ( $have !~ /\A$lax_version_re\z/ ) {
139 push @dep_errors, "$mod version '$have' cannot be parsed ($req_string)";
140 }
141 elsif ( ! $full_prereqs->requirements_for( $phase, $type )->accepts_module( $mod => $have ) ) {
142 push @dep_errors, "$mod version '$have' is not in required range '$want'";
143 }
144 }
145 }
146 else {
147 push @reports, [$mod, $want, "missing"];
148
149 if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
150 push @dep_errors, "$mod is not installed ($req_string)";
151 }
152 }
153 }
154
155 if ( @reports ) {
156 push @full_reports, "=== $title ===\n\n";
157
158 my $ml = _max( map { length $_->[0] } @reports );
159 my $wl = _max( map { length $_->[1] } @reports );
160 my $hl = _max( map { length $_->[2] } @reports );
161 splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
162
163 push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
164 push @full_reports, "\n";
165 }
166 }
167 }
168
169 if ( @full_reports ) {
170 diag "\nVersions for all modules listed in $source (including optional ones):\n\n", @full_reports;
171 }
172
173 if ( @dep_errors ) {
174 diag join("\n",
175 "\n*** WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING ***\n",
176 "The following REQUIRED prerequisites were not satisfied:\n",
177 @dep_errors,
178 "\n"
179 );
180 }
181
182 pass;
183
184 # vim: ts=4 sts=4 sw=4 et:
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # displays some basic info
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE::Component::SSLify;
18
19 # only available > 1.42
20 eval {
21 diag( "\nNet::SSLeay::ver_number is 0x" . sprintf( "%x", Net::SSLeay::SSLeay() ) );
22 diag( "\t" . Net::SSLeay::SSLeay_version( 0 ) );
23 diag( "\t" . Net::SSLeay::SSLeay_version( 2 ) );
24 diag( "\t" . Net::SSLeay::SSLeay_version( 3 ) );
25 diag( "\t" . Net::SSLeay::SSLeay_version( 4 ) );
26 };
27
28 # Idea taken from POE t/00_info.t :)
29 my $done = 0;
30 my $x = 0;
31 $SIG{ALRM} = sub { diag "\tpogomips: $x"; $done = 1; };
32 alarm(1);
33 ++$x until $done;
34
35 ok(1, "fake test for info");
36 done_testing;
+0
-88
t/000-report-versions-tiny.t less more
0 use strict;
1 use warnings;
2 use Test::More 0.88;
3 # This is a relatively nice way to avoid Test::NoWarnings breaking our
4 # expectations by adding extra tests, without using no_plan. It also helps
5 # avoid any other test module that feels introducing random tests, or even
6 # test plans, is a nice idea.
7 our $success = 0;
8 END { $success && done_testing; }
9
10 my $v = "\n";
11
12 # List our own version used to generate this
13 $v .= "Generated by Dist::Zilla::Plugin::ReportVersions::Tiny v1.03\n";
14
15 eval { # no excuses!
16 # report our Perl details
17 my $want = '5.006';
18 my $pv = ($^V || $]);
19 $v .= "perl: $pv (wanted $want) on $^O from $^X\n\n";
20 };
21 defined($@) and diag("$@");
22
23 # Now, our module version dependencies:
24 sub pmver {
25 my ($module, $wanted) = @_;
26 $wanted = " (want $wanted)";
27 my $pmver;
28 eval "require $module;";
29 if ($@) {
30 if ($@ =~ m/Can't locate .* in \@INC/) {
31 $pmver = 'module not found.';
32 } else {
33 diag("${module}: $@");
34 $pmver = 'died during require.';
35 }
36 } else {
37 my $version;
38 eval { $version = $module->VERSION; };
39 if ($@) {
40 diag("${module}: $@");
41 $pmver = 'died during VERSION check.';
42 } elsif (defined $version) {
43 $pmver = "$version";
44 } else {
45 $pmver = '<undef>';
46 }
47 }
48
49 # So, we should be good, right?
50 return sprintf('%-45s => %-10s%-15s%s', $module, $pmver, $wanted, "\n");
51 }
52
53 eval { $v .= pmver('Exporter','any version') };
54 eval { $v .= pmver('File::Find','any version') };
55 eval { $v .= pmver('File::Temp','any version') };
56 eval { $v .= pmver('IO::Handle','1.28') };
57 eval { $v .= pmver('Module::Build','0.3601') };
58 eval { $v .= pmver('Net::SSLeay','1.36') };
59 eval { $v .= pmver('POE','1.267') };
60 eval { $v .= pmver('POE::Component::Client::TCP','any version') };
61 eval { $v .= pmver('POE::Component::Server::TCP','any version') };
62 eval { $v .= pmver('Scalar::Util','any version') };
63 eval { $v .= pmver('Socket','any version') };
64 eval { $v .= pmver('Symbol','any version') };
65 eval { $v .= pmver('Task::Weaken','1.03') };
66 eval { $v .= pmver('Test::More','0.88') };
67 eval { $v .= pmver('parent','any version') };
68
69
70
71 # All done.
72 $v .= <<'EOT';
73
74 Thanks for using my code. I hope it works for you.
75 If not, please try and include this output in the bug report.
76 That will help me reproduce the issue and solve your problem.
77
78 EOT
79
80 diag($v);
81 ok(1, "we really didn't test anything, just reporting data");
82 $success = 1;
83
84 # Work around another nasty module on CPAN. :/
85 no warnings 'once';
86 $Template::Test::NO_FLUSH = 1;
87 exit 0;
+0
-169
t/1_simple.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This tests the basic functionality of sslify on client/server side
14
15 my $numtests;
16 BEGIN {
17 $numtests = 16;
18
19 eval "use Test::NoWarnings";
20 if ( ! $@ ) {
21 # increment by one
22 $numtests++;
23 }
24 }
25
26 use Test::More tests => $numtests;
27
28 use POE 1.267;
29 use POE::Component::Client::TCP;
30 use POE::Component::Server::TCP;
31 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
32
33 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
34
35 my $port;
36
37 POE::Component::Server::TCP->new
38 (
39 Alias => 'myserver',
40 Address => '127.0.0.1',
41 Port => 0,
42
43 Started => sub
44 {
45 use Socket qw/sockaddr_in/;
46 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
47 },
48 ClientConnected => sub
49 {
50 ok(1, 'SERVER: accepted');
51 },
52 ClientDisconnected => sub
53 {
54 ok(1, 'SERVER: client disconnected');
55 $_[KERNEL]->post(myserver => 'shutdown');
56 },
57 ClientPreConnect => sub
58 {
59 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
60 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
61 ok(!$@, "SERVER: SSLify_Options $@");
62
63 my $socket = eval { Server_SSLify($_[ARG0]) };
64 ok(!$@, "SERVER: Server_SSLify $@");
65 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
66
67 # We pray that IO::Handle is sane...
68 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?');
69
70 return ($socket);
71 },
72 ClientInput => sub
73 {
74 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
75
76 if ( $line eq 'ping' ) {
77 ok(1, "SERVER: recv: $line");
78
79 ## At this point, connection MUST be encrypted.
80 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
81 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
82
83 $heap->{client}->put("pong");
84 } else {
85 die "Unknown line from CLIENT: $line";
86 }
87 },
88 ClientError => sub
89 {
90 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
91 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
92 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
93
94 # TODO are there other "errors" that is harmless?
95 $error = "Normal disconnection" unless $error;
96 my $msg = "Got SERVER $syscall error $errno: $error";
97 unless ( $syscall eq 'read' and $errno == 0 ) {
98 fail( $msg );
99 } else {
100 diag( $msg ) if $ENV{TEST_VERBOSE};
101 }
102 },
103 );
104
105 POE::Component::Client::TCP->new
106 (
107 Alias => 'myclient',
108 RemoteAddress => '127.0.0.1',
109 RemotePort => $port,
110
111 Connected => sub
112 {
113 ok(1, 'CLIENT: connected');
114
115 $_[HEAP]->{server}->put("ping");
116 },
117 PreConnect => sub
118 {
119 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
120 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
121 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
122 ok(!$@, "CLIENT: Client_SSLify $@");
123 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
124
125 # We pray that IO::Handle is sane...
126 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?');
127
128 return ($socket);
129 },
130 ServerInput => sub
131 {
132 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
133
134 if ($line eq 'pong') {
135 ok(1, "CLIENT: recv: $line");
136
137 ## At this point, connection MUST be encrypted.
138 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
139 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
140 diag( Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $heap->{server}->get_output_handle ) ) ) if $ENV{TEST_VERBOSE};
141
142 $kernel->yield('shutdown');
143 } else {
144 die "Unknown line from SERVER: $line";
145 }
146 },
147 ServerError => sub
148 {
149 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
150 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
151 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
152
153 # TODO are there other "errors" that is harmless?
154 $error = "Normal disconnection" unless $error;
155 my $msg = "Got CLIENT $syscall error $errno: $error";
156 unless ( $syscall eq 'read' and $errno == 0 ) {
157 fail( $msg );
158 } else {
159 diag( $msg ) if $ENV{TEST_VERBOSE};
160 }
161 },
162 );
163
164 $poe_kernel->run();
165
166 pass( 'shut down sanely' );
167
168 exit 0;
+0
-188
t/2_renegotiate_client.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This test adds renegotiation to the connection from client-side
14
15 # In an older version of this test, there was ok() littered everywhere
16 # but dngor replied in http://rt.cpan.org/Public/Bug/Display.html?id=66741
17 # that it's not going to work... how do I predict which ok() will fail and "simulate" them?
18 # the solution was to... only run a few tests and print the diag
19 # because the rest of the tests just redo what we already have in 1_simple.t and stuff...
20
21 my $numtests;
22 BEGIN {
23 $numtests = 16;
24
25 eval "use Test::NoWarnings";
26 if ( ! $@ ) {
27 # increment by one
28 $numtests++;
29 }
30 }
31
32 use Test::More tests => $numtests;
33
34 use POE 1.267;
35 use POE::Component::Client::TCP;
36 use POE::Component::Server::TCP;
37 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
38 use Net::SSLeay qw/ERROR_WANT_READ ERROR_WANT_WRITE/;
39
40 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
41
42 my $port;
43 my $server_ping2;
44 my $client_ping2;
45
46 POE::Component::Server::TCP->new
47 (
48 Alias => 'myserver',
49 Address => '127.0.0.1',
50 Port => 0,
51
52 Started => sub
53 {
54 use Socket qw/sockaddr_in/;
55 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
56 },
57 ClientConnected => sub
58 {
59 ok(1, 'SERVER: accepted');
60 },
61 ClientDisconnected => sub
62 {
63 ok(1, 'SERVER: client disconnected');
64 $_[KERNEL]->post(myserver => 'shutdown');
65 },
66 ClientPreConnect => sub
67 {
68 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
69 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
70 ok(!$@, "SERVER: SSLify_Options $@");
71
72 my $socket = eval { Server_SSLify($_[ARG0]) };
73 ok(!$@, "SERVER: Server_SSLify $@");
74 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
75
76 # We pray that IO::Handle is sane...
77 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?');
78
79 return ($socket);
80 },
81 ClientInput => sub
82 {
83 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
84
85 if ($line eq 'ping') {
86 ok(1, "SERVER: recv: $line");
87
88 ## At this point, connection MUST be encrypted.
89 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
90 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
91
92 $heap->{client}->put("pong");
93 } elsif ($line eq 'ping2') {
94 $server_ping2++;
95 $heap->{client}->put("pong2");
96 } else {
97 die "Unknown line from CLIENT: $line";
98 }
99 },
100 ClientError => sub
101 {
102 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
103 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
104 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
105
106 # TODO are there other "errors" that is harmless?
107 $error = "Normal disconnection" unless $error;
108 my $msg = "Got SERVER $syscall error $errno: $error";
109 unless ( $syscall eq 'read' and $errno == 0 ) {
110 # fail( $msg );
111 } else {
112 diag( $msg ) if $ENV{TEST_VERBOSE};
113 }
114 },
115 );
116
117 POE::Component::Client::TCP->new
118 (
119 Alias => 'myclient',
120 RemoteAddress => '127.0.0.1',
121 RemotePort => $port,
122
123 Connected => sub
124 {
125 ok(1, 'CLIENT: connected');
126
127 $_[HEAP]->{server}->put("ping");
128 },
129 PreConnect => sub
130 {
131 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
132 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
133 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
134 ok(!$@, "CLIENT: Client_SSLify $@");
135 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
136
137 # We pray that IO::Handle is sane...
138 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?');
139
140 return ($socket);
141 },
142 ServerInput => sub
143 {
144 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
145
146 if ($line eq 'pong') {
147 ok(1, "CLIENT: recv: $line");
148
149 ## At this point, connection MUST be encrypted.
150 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
151 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
152
153 # do the actual renegotiate
154 Net::SSLeay::renegotiate( SSLify_GetSSL( $heap->{server}->get_output_handle ) );
155
156 $heap->{server}->put('ping2');
157 } elsif ($line eq 'pong2') {
158 $client_ping2++;
159 $kernel->yield('shutdown');
160 } else {
161 die "Unknown line from SERVER: $line";
162 }
163 },
164 ServerError => sub
165 {
166 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
167 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
168 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
169
170 $error = "Normal disconnection" unless $error;
171 my $msg = "Got CLIENT $syscall error $errno: $error";
172 diag( $msg ) if $ENV{TEST_VERBOSE};
173 },
174 );
175
176 $poe_kernel->run();
177
178 if ( ! $server_ping2 or ! $client_ping2 ) {
179 diag( "WARNING: Your platform/SSL library does not support renegotiation of the SSL socket." );
180 diag( "This test harness detected that trying to renegotiate resulted in a disconnected socket." );
181 diag( "POE::Component::SSLify will work on your system, but please do not attempt a SSL renegotiate." );
182 diag( "Please talk with the author to figure out if this issue can be worked around, thank you!" );
183 }
184
185 pass( 'shut down sanely' );
186
187 exit 0;
+0
-193
t/3_upgrade.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This tests in-situ sslification ( upgrade a non-ssl socket to ssl )
13
14 my $numtests;
15 BEGIN {
16 $numtests = 18;
17
18 eval "use Test::NoWarnings";
19 if ( ! $@ ) {
20 # increment by one
21 $numtests++;
22 }
23 }
24
25 use Test::More tests => $numtests;
26
27 use POE 1.267;
28 use POE::Component::Client::TCP;
29 use POE::Component::Server::TCP;
30 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket/;
31
32 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
33
34 my $port;
35
36 POE::Component::Server::TCP->new
37 (
38 Alias => 'myserver',
39 Address => '127.0.0.1',
40 Port => 0,
41
42 Started => sub
43 {
44 use Socket qw/sockaddr_in/;
45 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
46 },
47 ClientConnected => sub
48 {
49 ok(1, 'SERVER: accepted');
50 },
51 ClientDisconnected => sub
52 {
53 ok(1, 'SERVER: client disconnected');
54 $_[KERNEL]->post(myserver => 'shutdown');
55 },
56 ClientInput => sub
57 {
58 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
59
60 if ( $line eq 'plaintext_ping' ) {
61 ok(1, "SERVER: recv: $line");
62 $heap->{client}->put('plaintext_pong');
63 $heap->{client}->flush; # make sure we sent the pong
64
65 # sslify it in-situ!
66 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
67 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
68 ok(!$@, "SERVER: SSLify_Options $@");
69 my $socket = eval { Server_SSLify($heap->{client}->get_output_handle) };
70 ok(!$@, "SERVER: Server_SSLify $@");
71 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
72
73 # We pray that IO::Handle is sane...
74 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?');
75
76 # TODO evil code here, ha!
77 # Should I ask rcaputo to add a $rw->replace_handle($socket) method?
78 # if you don't do the undef and just replace it - you'll get a bad file descriptor error from POE!
79 # <fh> select error: Bad file descriptor (hits=-1)
80 undef $heap->{client};
81 $heap->{client} = POE::Wheel::ReadWrite->new(
82 Handle => $socket,
83 InputEvent => 'tcp_server_got_input',
84 ErrorEvent => 'tcp_server_got_error',
85 FlushedEvent => 'tcp_server_got_flush',
86 );
87 } elsif ( $line eq 'ssl_ping' ) {
88 ok(1, "SERVER: recv: $line");
89
90 ## At this point, connection MUST be encrypted.
91 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
92 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
93
94 $heap->{client}->put('ssl_pong');
95 } else {
96 die "Unknown line from CLIENT: $line";
97 }
98 },
99 ClientError => sub
100 {
101 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
102 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
103 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
104
105 # TODO are there other "errors" that is harmless?
106 $error = "Normal disconnection" unless $error;
107 my $msg = "Got SERVER $syscall error $errno: $error";
108 unless ( $syscall eq 'read' and $errno == 0 ) {
109 fail( $msg );
110 } else {
111 diag( $msg ) if $ENV{TEST_VERBOSE};
112 }
113 },
114 );
115
116 POE::Component::Client::TCP->new
117 (
118 Alias => 'myclient',
119 RemoteAddress => '127.0.0.1',
120 RemotePort => $port,
121
122 Connected => sub
123 {
124 ok(1, 'CLIENT: connected');
125
126 $_[HEAP]->{server}->put("plaintext_ping");
127 },
128 ServerInput => sub
129 {
130 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
131
132 if ( $line eq 'plaintext_pong' ) {
133 ok(1, "CLIENT: recv: $line");
134
135 # sslify it in-situ!
136 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
137 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
138 my $socket = eval { Client_SSLify($heap->{server}->get_output_handle, undef, undef, $ctx) };
139 ok(!$@, "CLIENT: Client_SSLify $@");
140 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
141
142 # We pray that IO::Handle is sane...
143 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?');
144
145 # TODO evil code here, ha!
146 # Should I ask rcaputo to add a $rw->replace_handle($socket) method?
147 # if you don't do the undef and just replace it - you'll get a bad file descriptor error from POE!
148 # <fh> select error: Bad file descriptor (hits=-1)
149 undef $heap->{server};
150 $heap->{server} = POE::Wheel::ReadWrite->new(
151 Handle => $socket,
152 InputEvent => 'got_server_input',
153 ErrorEvent => 'got_server_error',
154 FlushedEvent => 'got_server_flush',
155 );
156
157 # Send the ssl ping!
158 $heap->{server}->put('ssl_ping');
159 } elsif ( $line eq 'ssl_pong' ) {
160 ok(1, "CLIENT: recv: $line");
161
162 ## At this point, connection MUST be encrypted.
163 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
164 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
165
166 $kernel->yield('shutdown');
167 } else {
168 die "Unknown line from SERVER: $line";
169 }
170 },
171 ServerError => sub
172 {
173 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
174 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
175 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
176
177 # TODO are there other "errors" that is harmless?
178 $error = "Normal disconnection" unless $error;
179 my $msg = "Got CLIENT $syscall error $errno: $error";
180 unless ( $syscall eq 'read' and $errno == 0 ) {
181 fail( $msg );
182 } else {
183 diag( $msg ) if $ENV{TEST_VERBOSE};
184 }
185 },
186 );
187
188 $poe_kernel->run();
189
190 pass( 'shut down sanely' );
191
192 exit 0;
+0
-168
t/4_connect_hook.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This tests the connection OK hook on both server/client
13
14 my $numtests;
15 BEGIN {
16 $numtests = 19;
17
18 eval "use Test::NoWarnings";
19 if ( ! $@ ) {
20 # increment by one
21 $numtests++;
22 }
23 }
24
25 use Test::More tests => $numtests;
26
27 use POE 1.267;
28 use POE::Component::Client::TCP;
29 use POE::Component::Server::TCP;
30 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_GetSocket SSLify_GetStatus/;
31
32 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
33
34 my $port;
35
36 POE::Component::Server::TCP->new
37 (
38 Alias => 'myserver',
39 Address => '127.0.0.1',
40 Port => 0,
41
42 Started => sub
43 {
44 use Socket qw/sockaddr_in/;
45 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
46 },
47 ClientConnected => sub
48 {
49 ok(1, 'SERVER: accepted');
50 },
51 ClientDisconnected => sub
52 {
53 ok(1, 'SERVER: client disconnected');
54 $_[KERNEL]->post( 'myserver' => 'shutdown');
55 },
56 ClientPreConnect => sub
57 {
58 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt') };
59 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt') } if ($@);
60 ok(!$@, "SERVER: SSLify_Options $@");
61
62 my $socket = eval { Server_SSLify( $_[ARG0], sub {
63 my( $socket, $status, $errval ) = @_;
64
65 pass( "SERVER: Got callback hook" );
66 is( $status, 1, "SERVER: Status received from callback is OK" );
67
68 ## At this point, connection MUST be encrypted.
69 my $cipher = SSLify_GetCipher($socket);
70 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
71 ok( SSLify_GetStatus($socket) == 1, "SERVER: SSLify_GetStatus is done" );
72 } ) };
73 ok(!$@, "SERVER: Server_SSLify $@");
74 ok( SSLify_GetStatus($socket) == -1, "SERVER: SSLify_GetStatus is pending" );
75
76 return ($socket);
77 },
78 ClientInput => sub
79 {
80 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
81
82 if ( $line ne 'ping' ) {
83 die "Unknown line from CLIENT: $line";
84 } else {
85 ok(1, "SERVER: recv: $line");
86 $_[HEAP]->{client}->put("pong");
87 }
88 },
89 ClientError => sub
90 {
91 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
92 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
93 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
94
95 # TODO are there other "errors" that is harmless?
96 $error = "Normal disconnection" unless $error;
97 my $msg = "Got SERVER $syscall error $errno: $error";
98 unless ( $syscall eq 'read' and $errno == 0 ) {
99 fail( $msg );
100 } else {
101 diag( $msg ) if $ENV{TEST_VERBOSE};
102 }
103 },
104 );
105
106 POE::Component::Client::TCP->new
107 (
108 Alias => 'myclient',
109 RemoteAddress => '127.0.0.1',
110 RemotePort => $port,
111
112 Connected => sub
113 {
114 ok(1, 'CLIENT: connected');
115 $_[HEAP]->{server}->put("ping");
116 },
117 PreConnect => sub
118 {
119 my $socket = eval { Client_SSLify($_[ARG0], sub {
120 my( $socket, $status, $errval ) = @_;
121
122 pass( "CLIENT: Got callback hook status" );
123 is( $status, 1, "CLIENT: Status received from callback is OK" );
124
125 ## At this point, connection MUST be encrypted.
126 my $cipher = SSLify_GetCipher($socket);
127 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
128 ok( SSLify_GetStatus($socket) == 1, "CLIENT: SSLify_GetStatus is done" );
129 }) };
130 ok(!$@, "CLIENT: Client_SSLify $@");
131 ok( SSLify_GetStatus($socket) == -1, "CLIENT: SSLify_GetStatus is pending" );
132
133 return ($socket);
134 },
135 ServerInput => sub
136 {
137 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
138
139 if ( $line ne 'pong' ) {
140 die "Unknown line from CLIENT: $line";
141 } else {
142 ok(1, "CLIENT: recv: $line");
143 $kernel->yield('shutdown');
144 }
145 },
146 ServerError => sub
147 {
148 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
149 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
150 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
151
152 # TODO are there other "errors" that is harmless?
153 $error = "Normal disconnection" unless $error;
154 my $msg = "Got CLIENT $syscall error $errno: $error";
155 unless ( $syscall eq 'read' and $errno == 0 ) {
156 fail( $msg );
157 } else {
158 diag( $msg ) if $ENV{TEST_VERBOSE};
159 }
160 },
161 );
162
163 $poe_kernel->run();
164
165 pass( 'shut down sanely' );
166
167 exit 0;
+0
-122
t/5_connfail_client.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # this tests the connection fail hook on the client-side
13
14 my $numtests;
15 BEGIN {
16 $numtests = 8;
17
18 eval "use Test::NoWarnings";
19 if ( ! $@ ) {
20 # increment by one
21 $numtests++;
22 }
23 }
24
25 use Test::More tests => $numtests;
26
27 use POE 1.267;
28 use POE::Component::Client::TCP;
29 use POE::Component::Server::TCP;
30 use POE::Component::SSLify qw/Client_SSLify SSLify_GetSocket SSLify_GetStatus/;
31
32 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
33
34 my $port;
35
36 POE::Component::Server::TCP->new
37 (
38 Alias => 'myserver',
39 Address => '127.0.0.1',
40 Port => 0,
41
42 Started => sub
43 {
44 use Socket qw/sockaddr_in/;
45 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
46 },
47 ClientConnected => sub
48 {
49 ok(1, 'SERVER: accepted');
50
51 # purposefully send garbage so we screw up the ssl connect on the client-side
52 $_[HEAP]->{client}->put( 'garbage in, garbage out' );
53 },
54 ClientDisconnected => sub
55 {
56 ok(1, 'SERVER: client disconnected');
57 $_[KERNEL]->post( 'myserver' => 'shutdown');
58 },
59 ClientInput => sub
60 {
61 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
62
63 # purposefully send garbage so we screw up the ssl connect on the client-side
64 $heap->{client}->put( 'garbage in, garbage out' );
65 },
66 ClientError => sub
67 {
68 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
69 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
70 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
71 $error = "Normal disconnection" unless $error;
72 diag( "Got SERVER $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
73 },
74 );
75
76 POE::Component::Client::TCP->new
77 (
78 Alias => 'myclient',
79 RemoteAddress => '127.0.0.1',
80 RemotePort => $port,
81
82 Connected => sub
83 {
84 ok(1, 'CLIENT: connected');
85 },
86 PreConnect => sub
87 {
88 my $socket = eval { Client_SSLify($_[ARG0], sub {
89 my( $socket, $status, $errval ) = @_;
90
91 pass( "CLIENT: Got callback hook" );
92 is( $status, 0, "CLIENT: Status received from callback is ERR - $errval" );
93
94 $poe_kernel->post( 'myclient' => 'shutdown' );
95 }) };
96 ok(!$@, "CLIENT: Client_SSLify $@");
97 is( SSLify_GetStatus( $socket ), -1, "CLIENT: SSLify_GetStatus is pending" );
98
99 return ($socket);
100 },
101 ServerInput => sub
102 {
103 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
104
105 die "Should have never got any input from the server!";
106 },
107 ServerError => sub
108 {
109 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
110 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
111 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
112 $error = "Normal disconnection" unless $error;
113 diag( "Got CLIENT $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
114 },
115 );
116
117 $poe_kernel->run();
118
119 pass( 'shut down sanely' );
120
121 exit 0;
+0
-125
t/6_connfail_server.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # this tests the connection fail hook on the server-side
13
14 my $numtests;
15 BEGIN {
16 $numtests = 9;
17
18 eval "use Test::NoWarnings";
19 if ( ! $@ ) {
20 # increment by one
21 $numtests++;
22 }
23 }
24
25 use Test::More tests => $numtests;
26
27 use POE 1.267;
28 use POE::Component::Client::TCP;
29 use POE::Component::Server::TCP;
30 use POE::Component::SSLify qw/Server_SSLify SSLify_Options SSLify_GetSocket SSLify_GetStatus/;
31
32 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
33
34 my $port;
35
36 POE::Component::Server::TCP->new
37 (
38 Alias => 'myserver',
39 Address => '127.0.0.1',
40 Port => 0,
41
42 Started => sub
43 {
44 use Socket qw/sockaddr_in/;
45 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
46 },
47 ClientConnected => sub
48 {
49 ok(1, 'SERVER: accepted');
50 },
51 ClientPreConnect => sub
52 {
53 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt') };
54 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt') } if ($@);
55 ok(!$@, "SERVER: SSLify_Options $@");
56
57 my $socket = eval { Server_SSLify( $_[ARG0], sub {
58 my( $socket, $status, $errval ) = @_;
59
60 pass( "SERVER: Got callback hook" );
61 is( $status, 0, "SERVER: Status received from callback is ERR - $errval" );
62
63 $poe_kernel->post( 'myserver' => 'shutdown');
64 } ) };
65 ok(!$@, "SERVER: Server_SSLify $@");
66 is( SSLify_GetStatus( $socket ), -1, "SERVER: SSLify_GetStatus is pending" );
67
68 return ($socket);
69 },
70 ClientDisconnected => sub
71 {
72 ok(1, 'SERVER: client disconnected');
73 },
74 ClientInput => sub
75 {
76 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
77
78 die "Should have never got any input from the client!";
79 },
80 ClientError => sub
81 {
82 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
83 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
84 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
85 $error = "Normal disconnection" unless $error;
86 diag( "Got SERVER $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
87 },
88 );
89
90 POE::Component::Client::TCP->new
91 (
92 Alias => 'myclient',
93 RemoteAddress => '127.0.0.1',
94 RemotePort => $port,
95
96 Connected => sub
97 {
98 ok(1, 'CLIENT: connected');
99
100 # purposefully send garbage so we screw up the ssl connect on the client-side
101 $_[HEAP]->{server}->put( 'garbage in, garbage out' );
102 },
103 ServerInput => sub
104 {
105 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
106
107 # purposefully send garbage so we screw up the ssl connect on the client-side
108 $heap->{server}->put( 'garbage in, garbage out' );
109 },
110 ServerError => sub
111 {
112 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
113 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
114 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
115 $error = "Normal disconnection" unless $error;
116 diag( "Got CLIENT $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
117 },
118 );
119
120 $poe_kernel->run();
121
122 pass( 'shut down sanely' );
123
124 exit 0;
+0
-159
t/7_connect_hook_nodata.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This tests the connection OK hook on both server/client
13
14 my $numtests;
15 BEGIN {
16 $numtests = 17;
17
18 eval "use Test::NoWarnings";
19 if ( ! $@ ) {
20 # increment by one
21 $numtests++;
22 }
23 }
24
25 use Test::More tests => $numtests;
26
27 use POE 1.267;
28 use POE::Component::Client::TCP;
29 use POE::Component::Server::TCP;
30 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_GetSocket SSLify_GetStatus/;
31
32 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
33
34 my $port;
35
36 POE::Component::Server::TCP->new
37 (
38 Alias => 'myserver',
39 Address => '127.0.0.1',
40 Port => 0,
41
42 Started => sub
43 {
44 use Socket qw/sockaddr_in/;
45 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
46 },
47 ClientConnected => sub
48 {
49 ok(1, 'SERVER: accepted');
50 },
51 ClientDisconnected => sub
52 {
53 ok(1, 'SERVER: client disconnected');
54 $_[KERNEL]->post( 'myserver' => 'shutdown');
55 },
56 ClientPreConnect => sub
57 {
58 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt') };
59 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt') } if ($@);
60 ok(!$@, "SERVER: SSLify_Options $@");
61
62 my $socket = eval { Server_SSLify( $_[ARG0], sub {
63 my( $socket, $status, $errval ) = @_;
64
65 pass( "SERVER: Got callback hook" );
66 is( $status, 1, "SERVER: Status received from callback is OK" );
67
68 ## At this point, connection MUST be encrypted.
69 my $cipher = SSLify_GetCipher($socket);
70 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
71 ok( SSLify_GetStatus($socket) == 1, "SERVER: SSLify_GetStatus is done" );
72 } ) };
73 ok(!$@, "SERVER: Server_SSLify $@");
74 ok( SSLify_GetStatus($socket) == -1, "SERVER: SSLify_GetStatus is pending" );
75
76 return ($socket);
77 },
78 ClientInput => sub
79 {
80 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
81
82 die "Should have never got any input from the client!";
83 },
84 ClientError => sub
85 {
86 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
87 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
88 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
89
90 # TODO are there other "errors" that is harmless?
91 $error = "Normal disconnection" unless $error;
92 my $msg = "Got SERVER $syscall error $errno: $error";
93 unless ( $syscall eq 'read' and $errno == 0 ) {
94 fail( $msg );
95 } else {
96 diag( $msg ) if $ENV{TEST_VERBOSE};
97 }
98 },
99 );
100
101 POE::Component::Client::TCP->new
102 (
103 Alias => 'myclient',
104 RemoteAddress => '127.0.0.1',
105 RemotePort => $port,
106
107 Connected => sub
108 {
109 ok(1, 'CLIENT: connected');
110 },
111 PreConnect => sub
112 {
113 my $socket = eval { Client_SSLify($_[ARG0], sub {
114 my( $socket, $status, $errval ) = @_;
115
116 pass( "CLIENT: Got callback hook" );
117 is( $status, 1, "CLIENT: Status received from callback is OK" );
118
119 ## At this point, connection MUST be encrypted.
120 my $cipher = SSLify_GetCipher($socket);
121 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
122 ok( SSLify_GetStatus($socket) == 1, "CLIENT: SSLify_GetStatus is done" );
123
124 $poe_kernel->post( 'myclient' => 'shutdown' );
125 }) };
126 ok(!$@, "CLIENT: Client_SSLify $@");
127 ok( SSLify_GetStatus($socket) == -1, "CLIENT: SSLify_GetStatus is pending" );
128
129 return ($socket);
130 },
131 ServerInput => sub
132 {
133 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
134
135 die "Should have never got any input from the server!";
136 },
137 ServerError => sub
138 {
139 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
140 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
141 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
142
143 # TODO are there other "errors" that is harmless?
144 $error = "Normal disconnection" unless $error;
145 my $msg = "Got CLIENT $syscall error $errno: $error";
146 unless ( $syscall eq 'read' and $errno == 0 ) {
147 fail( $msg );
148 } else {
149 diag( $msg ) if $ENV{TEST_VERBOSE};
150 }
151 },
152 );
153
154 $poe_kernel->run();
155
156 pass( 'shut down sanely' );
157
158 exit 0;
+0
-185
t/8_renegotiate_server.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This test adds renegotiation to the connection from server-side
14
15 # In an older version of this test, there was ok() littered everywhere
16 # but dngor replied in http://rt.cpan.org/Public/Bug/Display.html?id=66741
17 # that it's not going to work... how do I predict which ok() will fail and "simulate" them?
18 # the solution was to... only run a few tests and print the diag
19 # because the rest of the tests just redo what we already have in 1_simple.t and stuff...
20
21 my $numtests;
22 BEGIN {
23 $numtests = 16;
24
25 eval "use Test::NoWarnings";
26 if ( ! $@ ) {
27 # increment by one
28 $numtests++;
29 }
30 }
31
32 use Test::More tests => $numtests;
33
34 use POE 1.267;
35 use POE::Component::Client::TCP;
36 use POE::Component::Server::TCP;
37 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
38
39 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
40
41 my $port;
42 my $server_ping2;
43 my $client_ping2;
44
45 POE::Component::Server::TCP->new
46 (
47 Alias => 'myserver',
48 Address => '127.0.0.1',
49 Port => 0,
50
51 Started => sub
52 {
53 use Socket qw/sockaddr_in/;
54 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
55 },
56 ClientConnected => sub
57 {
58 ok(1, 'SERVER: accepted');
59 $_[HEAP]->{client}->put("ping");
60 },
61 ClientDisconnected => sub
62 {
63 ok(1, 'SERVER: client disconnected');
64 $_[KERNEL]->post(myserver => 'shutdown');
65 },
66 ClientPreConnect => sub
67 {
68 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
69 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
70 ok(!$@, "SERVER: SSLify_Options $@");
71
72 my $socket = eval { Server_SSLify($_[ARG0]) };
73 ok(!$@, "SERVER: Server_SSLify $@");
74 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
75
76 # We pray that IO::Handle is sane...
77 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?');
78
79 return ($socket);
80 },
81 ClientInput => sub
82 {
83 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
84
85 if ($line eq 'pong') {
86 ok(1, "SERVER: recv: $line");
87
88 ## At this point, connection MUST be encrypted.
89 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
90 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
91
92 Net::SSLeay::renegotiate( SSLify_GetSSL( $heap->{client}->get_output_handle ) );
93
94 $heap->{client}->put("ping2");
95 } elsif ($line eq 'pong2') {
96 $server_ping2++;
97 $kernel->yield( 'shutdown' );
98 } else {
99 die "Unknown line from CLIENT: $line";
100 }
101 },
102 ClientError => sub
103 {
104 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
105 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
106 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
107
108 # TODO are there other "errors" that is harmless?
109 $error = "Normal disconnection" unless $error;
110 my $msg = "Got SERVER $syscall error $errno: $error";
111 unless ( $syscall eq 'read' and $errno == 0 ) {
112 # fail( $msg );
113 } else {
114 diag( $msg ) if $ENV{TEST_VERBOSE};
115 }
116 },
117 );
118
119 POE::Component::Client::TCP->new
120 (
121 Alias => 'myclient',
122 RemoteAddress => '127.0.0.1',
123 RemotePort => $port,
124
125 Connected => sub
126 {
127 ok(1, 'CLIENT: connected');
128 },
129 PreConnect => sub
130 {
131 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
132 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
133 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
134 ok(!$@, "CLIENT: Client_SSLify $@");
135 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
136
137 # We pray that IO::Handle is sane...
138 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?');
139
140 return ($socket);
141 },
142 ServerInput => sub
143 {
144 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
145
146 if ($line eq 'ping') {
147 ok(1, "CLIENT: recv: $line");
148
149 ## At this point, connection MUST be encrypted.
150 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
151 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
152
153 $_[HEAP]->{server}->put("pong");
154 } elsif ( $line eq 'ping2' ) {
155 $client_ping2++;
156 $_[HEAP]->{server}->put("pong2");
157 } else {
158 die "Unknown line from SERVER: $line";
159 }
160 },
161 ServerError => sub
162 {
163 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
164 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
165 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
166
167 $error = "Normal disconnection" unless $error;
168 my $msg = "Got CLIENT $syscall error $errno: $error";
169 diag( $msg ) if $ENV{TEST_VERBOSE};
170 },
171 );
172
173 $poe_kernel->run();
174
175 if ( ! $server_ping2 or ! $client_ping2 ) {
176 diag( "WARNING: Your platform/SSL library does not support renegotiation of the SSL socket." );
177 diag( "This test harness detected that trying to renegotiate resulted in a disconnected socket." );
178 diag( "POE::Component::SSLify will work on your system, but please do not attempt a SSL renegotiate." );
179 diag( "Please talk with the author to figure out if this issue can be worked around, thank you!" );
180 }
181
182 pass( 'shut down sanely' );
183
184 exit 0;
+0
-224
t/98_renegotiate.t less more
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2011 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This test adds renegotiation to the connection from client-side
14 # Since this is not supported on all platforms, it's marked TODO and adds custom logic
15 # to make sure it doesn't FAIL if it's not supported.
16
17 # this version of the test doesn't work as reported in http://rt.cpan.org/Public/Bug/Display.html?id=66741
18 # renamed it to this version for posterity and in case I need it for future analysis...
19
20 #my $numtests;
21 #BEGIN {
22 # $numtests = 23;
23 #
24 # eval "use Test::NoWarnings";
25 # if ( ! $@ ) {
26 # # increment by one
27 # $numtests++;
28 # }
29 #}
30
31 #use Test::More tests => $numtests;
32 use Test::More;
33 BEGIN {
34 plan skip_all => "AUTHOR TEST";
35 }
36
37 use POE 1.267;
38 use POE::Component::Client::TCP;
39 use POE::Component::Server::TCP;
40 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
41 use Net::SSLeay qw/ERROR_WANT_READ ERROR_WANT_WRITE/;
42
43 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
44
45 my $port;
46 my $server_ping2;
47 my $client_ping2;
48
49 POE::Component::Server::TCP->new
50 (
51 Alias => 'myserver',
52 Address => '127.0.0.1',
53 Port => 0,
54
55 Started => sub
56 {
57 use Socket qw/sockaddr_in/;
58 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
59 },
60 ClientConnected => sub
61 {
62 ok(1, 'SERVER: accepted');
63 },
64 ClientDisconnected => sub
65 {
66 ok(1, 'SERVER: client disconnected');
67 $_[KERNEL]->post(myserver => 'shutdown');
68 },
69 ClientPreConnect => sub
70 {
71 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
72 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
73 ok(!$@, "SERVER: SSLify_Options $@");
74
75 my $socket = eval { Server_SSLify($_[ARG0]) };
76 ok(!$@, "SERVER: Server_SSLify $@");
77 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
78
79 # We pray that IO::Handle is sane...
80 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?');
81
82 return ($socket);
83 },
84 ClientInput => sub
85 {
86 my ($kernel, $heap, $request) = @_[KERNEL, HEAP, ARG0];
87
88 ## At this point, connection MUST be encrypted.
89 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
90 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
91
92 if ($request eq 'ping')
93 {
94 ok(1, "SERVER: recv: $request");
95 $heap->{client}->put("pong");
96 }
97 elsif ($request eq 'ping2')
98 {
99 ok(1, "SERVER: recv: $request");
100 $server_ping2++;
101 $heap->{client}->put("pong2");
102 }
103 },
104 ClientError => sub
105 {
106 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
107 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
108 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
109
110 # TODO are there other "errors" that is harmless?
111 $error = "Normal disconnection" unless $error;
112 my $msg = "Got SERVER $syscall error $errno: $error";
113 unless ( $syscall eq 'read' and $errno == 0 ) {
114 fail( $msg );
115 } else {
116 diag( $msg ) if $ENV{TEST_VERBOSE};
117 }
118 },
119 );
120
121 POE::Component::Client::TCP->new
122 (
123 Alias => 'myclient',
124 RemoteAddress => '127.0.0.1',
125 RemotePort => $port,
126
127 Connected => sub
128 {
129 ok(1, 'CLIENT: connected');
130
131 $_[HEAP]->{server}->put("ping");
132 },
133 PreConnect => sub
134 {
135 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
136 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
137 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
138 ok(!$@, "CLIENT: Client_SSLify $@");
139 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
140
141 # We pray that IO::Handle is sane...
142 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?');
143
144 return ($socket);
145 },
146 ServerInput => sub
147 {
148 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
149
150 ## At this point, connection MUST be encrypted.
151 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
152 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
153
154 if ($line eq 'pong')
155 {
156 ok(1, "CLIENT: recv: $line");
157
158 # Skip 2 Net::SSLeay::renegotiate() tests on FreeBSD because of
159 # http://security.freebsd.org/advisories/FreeBSD-SA-09:15.ssl.asc
160 TODO: {
161 local $TODO = "Net::SSLeay::renegotiate() does not work on all platforms";
162
163 ## Force SSL renegotiation
164 my $ssl = SSLify_GetSSL( $heap->{server}->get_output_handle );
165 my $reneg_num = Net::SSLeay::num_renegotiations($ssl);
166
167 ok(1 == Net::SSLeay::renegotiate($ssl), 'CLIENT: SSL renegotiation');
168 my $handshake = Net::SSLeay::do_handshake($ssl);
169 my $err = Net::SSLeay::get_error($ssl, $handshake);
170
171 ## 1 == Successful handshake, ERROR_WANT_(READ|WRITE) == non-blocking.
172 ok($handshake == 1 || $err == ERROR_WANT_READ || $err == ERROR_WANT_WRITE, 'CLIENT: SSL handshake');
173 ok($reneg_num < Net::SSLeay::num_renegotiations($ssl), 'CLIENT: Increased number of negotiations');
174 }
175
176 $heap->{server}->put('ping2');
177 }
178
179 elsif ($line eq 'pong2')
180 {
181 ok(1, "CLIENT: recv: $line");
182 $client_ping2++;
183 $kernel->yield('shutdown');
184 }
185 },
186 ServerError => sub
187 {
188 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
189 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
190 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
191
192 # TODO are there other "errors" that is harmless?
193 $error = "Normal disconnection" unless $error;
194 my $msg = "Got CLIENT $syscall error $errno: $error";
195 unless ( $syscall eq 'read' and $errno == 0 ) {
196 fail( $msg );
197 } else {
198 diag( $msg ) if $ENV{TEST_VERBOSE};
199 }
200 },
201 );
202
203 $poe_kernel->run();
204
205 # Add extra pass() to make the test harness happy if renegotiate did not work
206 if ( ! $server_ping2 ) {
207 local $TODO = "Net::SSLeay::renegotiate() does not work on all platforms";
208 fail( "SERVER: Failed SSL renegotiation" );
209 }
210 if ( ! $client_ping2 ) {
211 local $TODO = "Net::SSLeay::renegotiate() does not work on all platforms";
212 fail( "CLIENT: Failed SSL renegotiation" );
213 }
214 if ( ! $server_ping2 or ! $client_ping2 ) {
215 diag( "WARNING: Your platform/SSL library does not support renegotiation of the SSL socket." );
216 diag( "This test harness detected that trying to renegotiate resulted in a disconnected socket." );
217 diag( "POE::Component::SSLify will work on your system, but please do not attempt a SSL renegotiate." );
218 diag( "Please talk with the author to figure out if this issue can be worked around, thank you!" );
219 }
220
221 pass( 'shut down sanely' );
222
223 exit 0;
11 #
22 # This file is part of POE-Component-SSLify
33 #
4 # This software is copyright (c) 2011 by Apocalypse.
4 # This software is copyright (c) 2014 by Apocalypse.
55 #
66 # This is free software; you can redistribute it and/or modify it under
77 # the same terms as the Perl 5 programming language system itself.
1919 # sub POE::Kernel::CATCH_EXCEPTIONS () { 0 } # make sure we die right away so it's easier to debug
2020 }
2121
22 use Test::More;
23 BEGIN {
24 plan skip_all => "AUTHOR TEST";
25 }
26
2227 use strict;
2328 use warnings;
2429 use POE;
25
26 use Test::More;
27 BEGIN {
28 plan skip_all => "AUTHOR TEST";
29 }
30 use Test::FailWarnings;
3031
3132 our $DEBUG=0;
3233
266267 },)->ID;
267268
268269 POE::Kernel->run();
269 exit;
270 done_testing;
11 #
22 # This file is part of POE-Component-SSLify
33 #
4 # This software is copyright (c) 2011 by Apocalypse.
4 # This software is copyright (c) 2014 by Apocalypse.
55 #
66 # This is free software; you can redistribute it and/or modify it under
77 # the same terms as the Perl 5 programming language system itself.
1414 if ( $@ ) {
1515 plan skip_all => 'Test::Apocalypse required for validating the distribution';
1616 } else {
17 # hack for Kwalitee ( zany require format so DZP::AutoPrereq will not pick it up )
18 require 'Test/NoWarnings.pm'; require 'Test/Pod.pm'; require 'Test/Pod/Coverage.pm';
19
2017 is_apocalypse_here( {
2118
2219 } );
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This tests the connection OK hook on both server/client
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_GetSocket SSLify_GetStatus/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25
26 POE::Component::Server::TCP->new
27 (
28 Alias => 'myserver',
29 Address => '127.0.0.1',
30 Port => 0,
31
32 Started => sub
33 {
34 use Socket qw/sockaddr_in/;
35 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
36 },
37 ClientConnected => sub
38 {
39 ok(1, 'SERVER: accepted');
40 },
41 ClientDisconnected => sub
42 {
43 ok(1, 'SERVER: client disconnected');
44 $_[KERNEL]->post( 'myserver' => 'shutdown');
45 },
46 ClientPreConnect => sub
47 {
48 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt') };
49 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt') } if ($@);
50 ok(!$@, "SERVER: SSLify_Options $@");
51
52 my $socket = eval { Server_SSLify( $_[ARG0], sub {
53 my( $socket, $status, $errval ) = @_;
54
55 pass( "SERVER: Got callback hook" );
56 is( $status, 1, "SERVER: Status received from callback is OK" );
57
58 ## At this point, connection MUST be encrypted.
59 my $cipher = SSLify_GetCipher($socket);
60 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
61 ok( SSLify_GetStatus($socket) == 1, "SERVER: SSLify_GetStatus is done" );
62 } ) };
63 ok(!$@, "SERVER: Server_SSLify $@");
64 ok( SSLify_GetStatus($socket) == -1, "SERVER: SSLify_GetStatus is pending" );
65
66 return ($socket);
67 },
68 ClientInput => sub
69 {
70 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
71
72 if ( $line ne 'ping' ) {
73 die "Unknown line from CLIENT: $line";
74 } else {
75 ok(1, "SERVER: recv: $line");
76 $_[HEAP]->{client}->put("pong");
77 }
78 },
79 ClientError => sub
80 {
81 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
82 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
83 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
84
85 # TODO are there other "errors" that is harmless?
86 $error = "Normal disconnection" unless $error;
87 my $msg = "Got SERVER $syscall error $errno: $error";
88 unless ( $syscall eq 'read' and $errno == 0 ) {
89 fail( $msg );
90 } else {
91 diag( $msg ) if $ENV{TEST_VERBOSE};
92 }
93 },
94 );
95
96 POE::Component::Client::TCP->new
97 (
98 Alias => 'myclient',
99 RemoteAddress => '127.0.0.1',
100 RemotePort => $port,
101
102 Connected => sub
103 {
104 ok(1, 'CLIENT: connected');
105 $_[HEAP]->{server}->put("ping");
106 },
107 PreConnect => sub
108 {
109 my $socket = eval { Client_SSLify($_[ARG0], sub {
110 my( $socket, $status, $errval ) = @_;
111
112 pass( "CLIENT: Got callback hook status" );
113 is( $status, 1, "CLIENT: Status received from callback is OK" );
114
115 ## At this point, connection MUST be encrypted.
116 my $cipher = SSLify_GetCipher($socket);
117 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
118 ok( SSLify_GetStatus($socket) == 1, "CLIENT: SSLify_GetStatus is done" );
119 }) };
120 ok(!$@, "CLIENT: Client_SSLify $@");
121 ok( SSLify_GetStatus($socket) == -1, "CLIENT: SSLify_GetStatus is pending" );
122
123 return ($socket);
124 },
125 ServerInput => sub
126 {
127 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
128
129 if ( $line ne 'pong' ) {
130 die "Unknown line from CLIENT: $line";
131 } else {
132 ok(1, "CLIENT: recv: $line");
133 $kernel->yield('shutdown');
134 }
135 },
136 ServerError => sub
137 {
138 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
139 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
140 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
141
142 # TODO are there other "errors" that is harmless?
143 $error = "Normal disconnection" unless $error;
144 my $msg = "Got CLIENT $syscall error $errno: $error";
145 unless ( $syscall eq 'read' and $errno == 0 ) {
146 fail( $msg );
147 } else {
148 diag( $msg ) if $ENV{TEST_VERBOSE};
149 }
150 },
151 );
152
153 $poe_kernel->run();
154
155 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This tests the connection OK hook on both server/client
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_GetSocket SSLify_GetStatus/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25
26 POE::Component::Server::TCP->new
27 (
28 Alias => 'myserver',
29 Address => '127.0.0.1',
30 Port => 0,
31
32 Started => sub
33 {
34 use Socket qw/sockaddr_in/;
35 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
36 },
37 ClientConnected => sub
38 {
39 ok(1, 'SERVER: accepted');
40 },
41 ClientDisconnected => sub
42 {
43 ok(1, 'SERVER: client disconnected');
44 $_[KERNEL]->post( 'myserver' => 'shutdown');
45 },
46 ClientPreConnect => sub
47 {
48 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt') };
49 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt') } if ($@);
50 ok(!$@, "SERVER: SSLify_Options $@");
51
52 my $socket = eval { Server_SSLify( $_[ARG0], sub {
53 my( $socket, $status, $errval ) = @_;
54
55 pass( "SERVER: Got callback hook" );
56 is( $status, 1, "SERVER: Status received from callback is OK" );
57
58 ## At this point, connection MUST be encrypted.
59 my $cipher = SSLify_GetCipher($socket);
60 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
61 ok( SSLify_GetStatus($socket) == 1, "SERVER: SSLify_GetStatus is done" );
62 } ) };
63 ok(!$@, "SERVER: Server_SSLify $@");
64 ok( SSLify_GetStatus($socket) == -1, "SERVER: SSLify_GetStatus is pending" );
65
66 return ($socket);
67 },
68 ClientInput => sub
69 {
70 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
71
72 die "Should have never got any input from the client!";
73 },
74 ClientError => sub
75 {
76 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
77 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
78 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
79
80 # TODO are there other "errors" that is harmless?
81 $error = "Normal disconnection" unless $error;
82 my $msg = "Got SERVER $syscall error $errno: $error";
83 unless ( $syscall eq 'read' and $errno == 0 ) {
84 fail( $msg );
85 } else {
86 diag( $msg ) if $ENV{TEST_VERBOSE};
87 }
88 },
89 );
90
91 POE::Component::Client::TCP->new
92 (
93 Alias => 'myclient',
94 RemoteAddress => '127.0.0.1',
95 RemotePort => $port,
96
97 Connected => sub
98 {
99 ok(1, 'CLIENT: connected');
100 },
101 PreConnect => sub
102 {
103 my $socket = eval { Client_SSLify($_[ARG0], sub {
104 my( $socket, $status, $errval ) = @_;
105
106 pass( "CLIENT: Got callback hook" );
107 is( $status, 1, "CLIENT: Status received from callback is OK" );
108
109 ## At this point, connection MUST be encrypted.
110 my $cipher = SSLify_GetCipher($socket);
111 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
112 ok( SSLify_GetStatus($socket) == 1, "CLIENT: SSLify_GetStatus is done" );
113
114 $poe_kernel->post( 'myclient' => 'shutdown' );
115 }) };
116 ok(!$@, "CLIENT: Client_SSLify $@");
117 ok( SSLify_GetStatus($socket) == -1, "CLIENT: SSLify_GetStatus is pending" );
118
119 return ($socket);
120 },
121 ServerInput => sub
122 {
123 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
124
125 die "Should have never got any input from the server!";
126 },
127 ServerError => sub
128 {
129 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
130 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
131 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
132
133 # TODO are there other "errors" that is harmless?
134 $error = "Normal disconnection" unless $error;
135 my $msg = "Got CLIENT $syscall error $errno: $error";
136 unless ( $syscall eq 'read' and $errno == 0 ) {
137 fail( $msg );
138 } else {
139 diag( $msg ) if $ENV{TEST_VERBOSE};
140 }
141 },
142 );
143
144 $poe_kernel->run();
145
146 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # this tests the connection fail hook on the client-side
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Client_SSLify SSLify_GetSocket SSLify_GetStatus/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25
26 POE::Component::Server::TCP->new
27 (
28 Alias => 'myserver',
29 Address => '127.0.0.1',
30 Port => 0,
31
32 Started => sub
33 {
34 use Socket qw/sockaddr_in/;
35 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
36 },
37 ClientConnected => sub
38 {
39 ok(1, 'SERVER: accepted');
40
41 # purposefully send garbage so we screw up the ssl connect on the client-side
42 $_[HEAP]->{client}->put( 'garbage in, garbage out' );
43 },
44 ClientDisconnected => sub
45 {
46 ok(1, 'SERVER: client disconnected');
47 $_[KERNEL]->post( 'myserver' => 'shutdown');
48 },
49 ClientInput => sub
50 {
51 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
52
53 # purposefully send garbage so we screw up the ssl connect on the client-side
54 $heap->{client}->put( 'garbage in, garbage out' );
55 },
56 ClientError => sub
57 {
58 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
59 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
60 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
61 $error = "Normal disconnection" unless $error;
62 diag( "Got SERVER $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
63 },
64 );
65
66 POE::Component::Client::TCP->new
67 (
68 Alias => 'myclient',
69 RemoteAddress => '127.0.0.1',
70 RemotePort => $port,
71
72 Connected => sub
73 {
74 ok(1, 'CLIENT: connected');
75 },
76 PreConnect => sub
77 {
78 my $socket = eval { Client_SSLify($_[ARG0], sub {
79 my( $socket, $status, $errval ) = @_;
80
81 pass( "CLIENT: Got callback hook" );
82 is( $status, 0, "CLIENT: Status received from callback is ERR - $errval" );
83
84 $poe_kernel->post( 'myclient' => 'shutdown' );
85 }) };
86 ok(!$@, "CLIENT: Client_SSLify $@");
87 is( SSLify_GetStatus( $socket ), -1, "CLIENT: SSLify_GetStatus is pending" );
88
89 return ($socket);
90 },
91 ServerInput => sub
92 {
93 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
94
95 die "Should have never got any input from the server!";
96 },
97 ServerError => sub
98 {
99 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
100 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
101 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
102 $error = "Normal disconnection" unless $error;
103 diag( "Got CLIENT $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
104 },
105 );
106
107 $poe_kernel->run();
108
109 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # this tests the connection fail hook on the server-side
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Server_SSLify SSLify_Options SSLify_GetSocket SSLify_GetStatus/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25
26 POE::Component::Server::TCP->new
27 (
28 Alias => 'myserver',
29 Address => '127.0.0.1',
30 Port => 0,
31
32 Started => sub
33 {
34 use Socket qw/sockaddr_in/;
35 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
36 },
37 ClientConnected => sub
38 {
39 ok(1, 'SERVER: accepted');
40 },
41 ClientPreConnect => sub
42 {
43 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt') };
44 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt') } if ($@);
45 ok(!$@, "SERVER: SSLify_Options $@");
46
47 my $socket = eval { Server_SSLify( $_[ARG0], sub {
48 my( $socket, $status, $errval ) = @_;
49
50 pass( "SERVER: Got callback hook" );
51 is( $status, 0, "SERVER: Status received from callback is ERR - $errval" );
52
53 $poe_kernel->post( 'myserver' => 'shutdown');
54 } ) };
55 ok(!$@, "SERVER: Server_SSLify $@");
56 is( SSLify_GetStatus( $socket ), -1, "SERVER: SSLify_GetStatus is pending" );
57
58 return ($socket);
59 },
60 ClientDisconnected => sub
61 {
62 ok(1, 'SERVER: client disconnected');
63 },
64 ClientInput => sub
65 {
66 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
67
68 die "Should have never got any input from the client!";
69 },
70 ClientError => sub
71 {
72 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
73 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
74 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
75 $error = "Normal disconnection" unless $error;
76 diag( "Got SERVER $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
77 },
78 );
79
80 POE::Component::Client::TCP->new
81 (
82 Alias => 'myclient',
83 RemoteAddress => '127.0.0.1',
84 RemotePort => $port,
85
86 Connected => sub
87 {
88 ok(1, 'CLIENT: connected');
89
90 # purposefully send garbage so we screw up the ssl connect on the client-side
91 $_[HEAP]->{server}->put( 'garbage in, garbage out' );
92 },
93 ServerInput => sub
94 {
95 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
96
97 # purposefully send garbage so we screw up the ssl connect on the client-side
98 $heap->{server}->put( 'garbage in, garbage out' );
99 },
100 ServerError => sub
101 {
102 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
103 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
104 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
105 $error = "Normal disconnection" unless $error;
106 diag( "Got CLIENT $syscall error $errno: $error" ) if $ENV{TEST_VERBOSE};
107 },
108 );
109
110 $poe_kernel->run();
111
112 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This test adds renegotiation to the connection from client-side
14
15 use Test::FailWarnings;
16 use Test::More 1.001002; # new enough for sanity in done_testing()
17
18 use POE 1.267;
19 use POE::Component::Client::TCP;
20 use POE::Component::Server::TCP;
21 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
22 use Net::SSLeay qw/ERROR_WANT_READ ERROR_WANT_WRITE/;
23
24 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
25
26 my $port;
27 my $server_ping2;
28 my $client_ping2;
29
30 POE::Component::Server::TCP->new
31 (
32 Alias => 'myserver',
33 Address => '127.0.0.1',
34 Port => 0,
35
36 Started => sub
37 {
38 use Socket qw/sockaddr_in/;
39 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
40 },
41 ClientConnected => sub
42 {
43 ok(1, 'SERVER: accepted');
44 },
45 ClientDisconnected => sub
46 {
47 ok(1, 'SERVER: client disconnected');
48 $_[KERNEL]->post(myserver => 'shutdown');
49 },
50 ClientPreConnect => sub
51 {
52 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
53 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
54 ok(!$@, "SERVER: SSLify_Options $@");
55
56 my $socket = eval { Server_SSLify($_[ARG0]) };
57 ok(!$@, "SERVER: Server_SSLify $@");
58 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
59
60 # We pray that IO::Handle is sane...
61 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
62
63 return ($socket);
64 },
65 ClientInput => sub
66 {
67 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
68
69 if ($line eq 'ping') {
70 ok(1, "SERVER: recv: $line");
71
72 ## At this point, connection MUST be encrypted.
73 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
74 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
75
76 $heap->{client}->put("pong");
77 } elsif ($line eq 'ping2') {
78 $server_ping2++;
79 $heap->{client}->put("pong2");
80 } else {
81 die "Unknown line from CLIENT: $line";
82 }
83 },
84 ClientError => sub
85 {
86 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
87 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
88 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
89
90 # TODO are there other "errors" that is harmless?
91 $error = "Normal disconnection" unless $error;
92 my $msg = "Got SERVER $syscall error $errno: $error";
93 unless ( $syscall eq 'read' and $errno == 0 ) {
94 # fail( $msg );
95 } else {
96 diag( $msg ) if $ENV{TEST_VERBOSE};
97 }
98 },
99 );
100
101 POE::Component::Client::TCP->new
102 (
103 Alias => 'myclient',
104 RemoteAddress => '127.0.0.1',
105 RemotePort => $port,
106
107 Connected => sub
108 {
109 ok(1, 'CLIENT: connected');
110
111 $_[HEAP]->{server}->put("ping");
112 },
113 PreConnect => sub
114 {
115 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
116 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
117 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
118 ok(!$@, "CLIENT: Client_SSLify $@");
119 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
120
121 # We pray that IO::Handle is sane...
122 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
123
124 return ($socket);
125 },
126 ServerInput => sub
127 {
128 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
129
130 if ($line eq 'pong') {
131 ok(1, "CLIENT: recv: $line");
132
133 ## At this point, connection MUST be encrypted.
134 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
135 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
136
137 # do the actual renegotiate
138 Net::SSLeay::renegotiate( SSLify_GetSSL( $heap->{server}->get_output_handle ) );
139
140 $heap->{server}->put('ping2');
141 } elsif ($line eq 'pong2') {
142 $client_ping2++;
143 $kernel->yield('shutdown');
144 } else {
145 die "Unknown line from SERVER: $line";
146 }
147 },
148 ServerError => sub
149 {
150 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
151 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
152 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
153
154 $error = "Normal disconnection" unless $error;
155 my $msg = "Got CLIENT $syscall error $errno: $error";
156 diag( $msg ) if $ENV{TEST_VERBOSE};
157 },
158 );
159
160 $poe_kernel->run();
161
162 if ( ! $server_ping2 or ! $client_ping2 ) {
163 diag( "WARNING: Your platform/SSL library does not support renegotiation of the SSL socket." );
164 diag( "This test harness detected that trying to renegotiate resulted in a disconnected socket." );
165 diag( "POE::Component::SSLify will work on your system, but please do not attempt a SSL renegotiate." );
166 diag( "Please talk with the author to figure out if this issue can be worked around, thank you!" );
167 }
168
169 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This test adds renegotiation to the connection from client-side
14 # Since this is not supported on all platforms, it's marked TODO and adds custom logic
15 # to make sure it doesn't FAIL if it's not supported.
16
17 use Test::FailWarnings;
18 use Test::More 1.001002; # new enough for sanity in done_testing()
19
20 use POE 1.267;
21 use POE::Component::Client::TCP;
22 use POE::Component::Server::TCP;
23 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
24 use Net::SSLeay qw/ERROR_WANT_READ ERROR_WANT_WRITE/;
25
26 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
27
28 my $port;
29 my $server_ping2;
30 my $client_ping2;
31
32 POE::Component::Server::TCP->new
33 (
34 Alias => 'myserver',
35 Address => '127.0.0.1',
36 Port => 0,
37
38 Started => sub
39 {
40 use Socket qw/sockaddr_in/;
41 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
42 },
43 ClientConnected => sub
44 {
45 ok(1, 'SERVER: accepted');
46 },
47 ClientDisconnected => sub
48 {
49 ok(1, 'SERVER: client disconnected');
50 $_[KERNEL]->post(myserver => 'shutdown');
51 },
52 ClientPreConnect => sub
53 {
54 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
55 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
56 ok(!$@, "SERVER: SSLify_Options $@");
57
58 my $socket = eval { Server_SSLify($_[ARG0]) };
59 ok(!$@, "SERVER: Server_SSLify $@");
60 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
61
62 # We pray that IO::Handle is sane...
63 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
64
65 return ($socket);
66 },
67 ClientInput => sub
68 {
69 my ($kernel, $heap, $request) = @_[KERNEL, HEAP, ARG0];
70
71 ## At this point, connection MUST be encrypted.
72 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
73 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
74
75 if ($request eq 'ping')
76 {
77 ok(1, "SERVER: recv: $request");
78 $heap->{client}->put("pong");
79 }
80 elsif ($request eq 'ping2')
81 {
82 ok(1, "SERVER: recv: $request");
83 $server_ping2++;
84 $heap->{client}->put("pong2");
85 }
86 },
87 ClientError => sub
88 {
89 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
90 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
91 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
92
93 # TODO are there other "errors" that is harmless?
94 $error = "Normal disconnection" unless $error;
95 my $msg = "Got SERVER $syscall error $errno: $error";
96 unless ( $syscall eq 'read' and $errno == 0 ) {
97 fail( $msg );
98 } else {
99 diag( $msg ) if $ENV{TEST_VERBOSE};
100 }
101 },
102 );
103
104 POE::Component::Client::TCP->new
105 (
106 Alias => 'myclient',
107 RemoteAddress => '127.0.0.1',
108 RemotePort => $port,
109
110 Connected => sub
111 {
112 ok(1, 'CLIENT: connected');
113
114 $_[HEAP]->{server}->put("ping");
115 },
116 PreConnect => sub
117 {
118 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
119 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
120 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
121 ok(!$@, "CLIENT: Client_SSLify $@");
122 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
123
124 # We pray that IO::Handle is sane...
125 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
126
127 return ($socket);
128 },
129 ServerInput => sub
130 {
131 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
132
133 ## At this point, connection MUST be encrypted.
134 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
135 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
136
137 if ($line eq 'pong')
138 {
139 ok(1, "CLIENT: recv: $line");
140
141 # Skip 2 Net::SSLeay::renegotiate() tests on FreeBSD because of
142 # http://security.freebsd.org/advisories/FreeBSD-SA-09:15.ssl.asc
143 TODO: {
144 local $TODO = "Net::SSLeay::renegotiate() does not work on all platforms";
145
146 ## Force SSL renegotiation
147 my $ssl = SSLify_GetSSL( $heap->{server}->get_output_handle );
148 my $reneg_num = Net::SSLeay::num_renegotiations($ssl);
149
150 ok(1 == Net::SSLeay::renegotiate($ssl), 'CLIENT: SSL renegotiation');
151 my $handshake = Net::SSLeay::do_handshake($ssl);
152 my $err = Net::SSLeay::get_error($ssl, $handshake);
153
154 ## 1 == Successful handshake, ERROR_WANT_(READ|WRITE) == non-blocking.
155 ok($handshake == 1 || $err == ERROR_WANT_READ || $err == ERROR_WANT_WRITE, 'CLIENT: SSL handshake');
156 ok($reneg_num < Net::SSLeay::num_renegotiations($ssl), 'CLIENT: Increased number of negotiations');
157 }
158
159 $heap->{server}->put('ping2');
160 }
161
162 elsif ($line eq 'pong2')
163 {
164 ok(1, "CLIENT: recv: $line");
165 $client_ping2++;
166 $kernel->yield('shutdown');
167 }
168 },
169 ServerError => sub
170 {
171 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
172 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
173 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
174
175 # TODO are there other "errors" that is harmless?
176 $error = "Normal disconnection" unless $error;
177 my $msg = "Got CLIENT $syscall error $errno: $error";
178 unless ( $syscall eq 'read' and $errno == 0 ) {
179 fail( $msg );
180 } else {
181 diag( $msg ) if $ENV{TEST_VERBOSE};
182 }
183 },
184 );
185
186 $poe_kernel->run();
187
188 # Add extra pass() to make the test harness happy if renegotiate did not work
189 if ( ! $server_ping2 ) {
190 local $TODO = "Net::SSLeay::renegotiate() does not work on all platforms";
191 fail( "SERVER: Failed SSL renegotiation" );
192 }
193 if ( ! $client_ping2 ) {
194 local $TODO = "Net::SSLeay::renegotiate() does not work on all platforms";
195 fail( "CLIENT: Failed SSL renegotiation" );
196 }
197 if ( ! $server_ping2 or ! $client_ping2 ) {
198 diag( "WARNING: Your platform/SSL library does not support renegotiation of the SSL socket." );
199 diag( "This test harness detected that trying to renegotiate resulted in a disconnected socket." );
200 diag( "POE::Component::SSLify will work on your system, but please do not attempt a SSL renegotiate." );
201 diag( "Please talk with the author to figure out if this issue can be worked around, thank you!" );
202 }
203
204 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This test adds renegotiation to the connection from server-side
14
15 use Test::FailWarnings;
16 use Test::More 1.001002; # new enough for sanity in done_testing()
17
18 use POE 1.267;
19 use POE::Component::Client::TCP;
20 use POE::Component::Server::TCP;
21 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
22
23 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
24
25 my $port;
26 my $server_ping2;
27 my $client_ping2;
28
29 POE::Component::Server::TCP->new
30 (
31 Alias => 'myserver',
32 Address => '127.0.0.1',
33 Port => 0,
34
35 Started => sub
36 {
37 use Socket qw/sockaddr_in/;
38 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
39 },
40 ClientConnected => sub
41 {
42 ok(1, 'SERVER: accepted');
43 $_[HEAP]->{client}->put("ping");
44 },
45 ClientDisconnected => sub
46 {
47 ok(1, 'SERVER: client disconnected');
48 $_[KERNEL]->post(myserver => 'shutdown');
49 },
50 ClientPreConnect => sub
51 {
52 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
53 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
54 ok(!$@, "SERVER: SSLify_Options $@");
55
56 my $socket = eval { Server_SSLify($_[ARG0]) };
57 ok(!$@, "SERVER: Server_SSLify $@");
58 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
59
60 # We pray that IO::Handle is sane...
61 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
62
63 return ($socket);
64 },
65 ClientInput => sub
66 {
67 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
68
69 if ($line eq 'pong') {
70 ok(1, "SERVER: recv: $line");
71
72 ## At this point, connection MUST be encrypted.
73 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
74 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
75
76 Net::SSLeay::renegotiate( SSLify_GetSSL( $heap->{client}->get_output_handle ) );
77
78 $heap->{client}->put("ping2");
79 } elsif ($line eq 'pong2') {
80 $server_ping2++;
81 $kernel->yield( 'shutdown' );
82 } else {
83 die "Unknown line from CLIENT: $line";
84 }
85 },
86 ClientError => sub
87 {
88 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
89 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
90 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
91
92 # TODO are there other "errors" that is harmless?
93 $error = "Normal disconnection" unless $error;
94 my $msg = "Got SERVER $syscall error $errno: $error";
95 unless ( $syscall eq 'read' and $errno == 0 ) {
96 # fail( $msg );
97 } else {
98 diag( $msg ) if $ENV{TEST_VERBOSE};
99 }
100 },
101 );
102
103 POE::Component::Client::TCP->new
104 (
105 Alias => 'myclient',
106 RemoteAddress => '127.0.0.1',
107 RemotePort => $port,
108
109 Connected => sub
110 {
111 ok(1, 'CLIENT: connected');
112 },
113 PreConnect => sub
114 {
115 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
116 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
117 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
118 ok(!$@, "CLIENT: Client_SSLify $@");
119 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
120
121 # We pray that IO::Handle is sane...
122 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
123
124 return ($socket);
125 },
126 ServerInput => sub
127 {
128 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
129
130 if ($line eq 'ping') {
131 ok(1, "CLIENT: recv: $line");
132
133 ## At this point, connection MUST be encrypted.
134 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
135 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
136
137 $_[HEAP]->{server}->put("pong");
138 } elsif ( $line eq 'ping2' ) {
139 $client_ping2++;
140 $_[HEAP]->{server}->put("pong2");
141 } else {
142 die "Unknown line from SERVER: $line";
143 }
144 },
145 ServerError => sub
146 {
147 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
148 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
149 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
150
151 $error = "Normal disconnection" unless $error;
152 my $msg = "Got CLIENT $syscall error $errno: $error";
153 diag( $msg ) if $ENV{TEST_VERBOSE};
154 },
155 );
156
157 $poe_kernel->run();
158
159 if ( ! $server_ping2 or ! $client_ping2 ) {
160 diag( "WARNING: Your platform/SSL library does not support renegotiation of the SSL socket." );
161 diag( "This test harness detected that trying to renegotiate resulted in a disconnected socket." );
162 diag( "POE::Component::SSLify will work on your system, but please do not attempt a SSL renegotiate." );
163 diag( "Please talk with the author to figure out if this issue can be worked around, thank you!" );
164 }
165
166 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # Thanks to ASCENT for this test!
13 # This tests the basic functionality of sslify on client/server side
14
15 use Test::FailWarnings;
16 use Test::More 1.001002; # new enough for sanity in done_testing()
17
18 use POE 1.267;
19 use POE::Component::Client::TCP;
20 use POE::Component::Server::TCP;
21 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
22
23 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
24
25 my $port;
26
27 POE::Component::Server::TCP->new
28 (
29 Alias => 'myserver',
30 Address => '127.0.0.1',
31 Port => 0,
32
33 Started => sub
34 {
35 use Socket qw/sockaddr_in/;
36 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
37 },
38 ClientConnected => sub
39 {
40 ok(1, 'SERVER: accepted');
41 },
42 ClientDisconnected => sub
43 {
44 ok(1, 'SERVER: client disconnected');
45 $_[KERNEL]->post(myserver => 'shutdown');
46 },
47 ClientPreConnect => sub
48 {
49 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
50 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
51 ok(!$@, "SERVER: SSLify_Options $@");
52
53 my $socket = eval { Server_SSLify($_[ARG0]) };
54 ok(!$@, "SERVER: Server_SSLify $@");
55 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
56
57 # We pray that IO::Handle is sane...
58 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
59
60 return ($socket);
61 },
62 ClientInput => sub
63 {
64 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
65
66 if ( $line eq 'ping' ) {
67 ok(1, "SERVER: recv: $line");
68
69 ## At this point, connection MUST be encrypted.
70 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
71 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
72
73 $heap->{client}->put("pong");
74 } else {
75 die "Unknown line from CLIENT: $line";
76 }
77 },
78 ClientError => sub
79 {
80 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
81 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
82 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
83
84 # TODO are there other "errors" that is harmless?
85 $error = "Normal disconnection" unless $error;
86 my $msg = "Got SERVER $syscall error $errno: $error";
87 unless ( $syscall eq 'read' and $errno == 0 ) {
88 fail( $msg );
89 } else {
90 diag( $msg ) if $ENV{TEST_VERBOSE};
91 }
92 },
93 );
94
95 POE::Component::Client::TCP->new
96 (
97 Alias => 'myclient',
98 RemoteAddress => '127.0.0.1',
99 RemotePort => $port,
100
101 Connected => sub
102 {
103 ok(1, 'CLIENT: connected');
104
105 $_[HEAP]->{server}->put("ping");
106 },
107 PreConnect => sub
108 {
109 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
110 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
111 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
112 ok(!$@, "CLIENT: Client_SSLify $@");
113 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
114
115 # We pray that IO::Handle is sane...
116 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
117
118 return ($socket);
119 },
120 ServerInput => sub
121 {
122 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
123
124 if ($line eq 'pong') {
125 ok(1, "CLIENT: recv: $line");
126
127 ## At this point, connection MUST be encrypted.
128 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
129 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
130 diag( Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $heap->{server}->get_output_handle ) ) ) if $ENV{TEST_VERBOSE};
131
132 $kernel->yield('shutdown');
133 } else {
134 die "Unknown line from SERVER: $line";
135 }
136 },
137 ServerError => sub
138 {
139 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
140 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
141 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
142
143 # TODO are there other "errors" that is harmless?
144 $error = "Normal disconnection" unless $error;
145 my $msg = "Got CLIENT $syscall error $errno: $error";
146 unless ( $syscall eq 'read' and $errno == 0 ) {
147 fail( $msg );
148 } else {
149 diag( $msg ) if $ENV{TEST_VERBOSE};
150 }
151 },
152 );
153
154 $poe_kernel->run();
155
156 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This is an extension of the simple.t test to test for large responses
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25
26 # length $bigpacket = 2079998 ( just need to go over 42643B as reported in RT#58243 but... =)
27 my $bigpacket = join( '-', ('a' .. 'z') x 10000, ('A' .. 'Z') x 10000 ) x 2;
28
29 POE::Component::Server::TCP->new
30 (
31 Alias => 'myserver',
32 Address => '127.0.0.1',
33 Port => 0,
34 ClientFilter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
35 Started => sub
36 {
37 use Socket qw/sockaddr_in/;
38 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
39 },
40 ClientConnected => sub
41 {
42 ok(1, 'SERVER: accepted');
43 },
44 ClientDisconnected => sub
45 {
46 ok(1, 'SERVER: client disconnected');
47 $_[KERNEL]->post(myserver => 'shutdown');
48 },
49 ClientPreConnect => sub
50 {
51 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
52 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
53 ok(!$@, "SERVER: SSLify_Options $@");
54
55 my $socket = eval { Server_SSLify($_[ARG0]) };
56 ok(!$@, "SERVER: Server_SSLify $@");
57 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
58
59 # We pray that IO::Handle is sane...
60 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
61
62 return ($socket);
63 },
64 ClientInput => sub
65 {
66 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
67
68 if ( $line eq $bigpacket ) {
69 ok(1, "SERVER: recv BIGPACKET");
70
71 ## At this point, connection MUST be encrypted.
72 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
73 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
74
75 $heap->{client}->put($bigpacket);
76 } else {
77 die "Unknown line from CLIENT: $line";
78 }
79 },
80 ClientError => sub
81 {
82 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
83 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
84 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
85
86 # TODO are there other "errors" that is harmless?
87 $error = "Normal disconnection" unless $error;
88 my $msg = "Got SERVER $syscall error $errno: $error";
89 unless ( $syscall eq 'read' and $errno == 0 ) {
90 fail( $msg );
91 } else {
92 diag( $msg ) if $ENV{TEST_VERBOSE};
93 }
94 },
95 );
96
97 POE::Component::Client::TCP->new
98 (
99 Alias => 'myclient',
100 RemoteAddress => '127.0.0.1',
101 RemotePort => $port,
102 Filter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
103 Connected => sub
104 {
105 ok(1, 'CLIENT: connected');
106
107 $_[HEAP]->{server}->put($bigpacket);
108 },
109 PreConnect => sub
110 {
111 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
112 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
113 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
114 ok(!$@, "CLIENT: Client_SSLify $@");
115 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
116
117 # We pray that IO::Handle is sane...
118 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
119
120 return ($socket);
121 },
122 ServerInput => sub
123 {
124 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
125
126 if ($line eq $bigpacket) {
127 ok(1, "CLIENT: recv BIGPACKET");
128
129 ## At this point, connection MUST be encrypted.
130 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
131 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
132 diag( Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $heap->{server}->get_output_handle ) ) ) if $ENV{TEST_VERBOSE};
133
134 $kernel->yield('shutdown');
135 } else {
136 die "Unknown line from SERVER: $line";
137 }
138 },
139 ServerError => sub
140 {
141 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
142 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
143 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
144
145 # TODO are there other "errors" that is harmless?
146 $error = "Normal disconnection" unless $error;
147 my $msg = "Got CLIENT $syscall error $errno: $error";
148 unless ( $syscall eq 'read' and $errno == 0 ) {
149 fail( $msg );
150 } else {
151 diag( $msg ) if $ENV{TEST_VERBOSE};
152 }
153 },
154 );
155
156 $poe_kernel->run();
157
158 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This is an extension of the simple.t to test requests in parallel
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25 my $replies = 0;
26
27 POE::Component::Server::TCP->new
28 (
29 Alias => 'myserver',
30 Address => '127.0.0.1',
31 Port => 0,
32
33 Started => sub
34 {
35 use Socket qw/sockaddr_in/;
36 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
37 },
38 ClientConnected => sub
39 {
40 ok(1, 'SERVER: accepted');
41 },
42 ClientDisconnected => sub
43 {
44 ok(1, 'SERVER: client disconnected');
45 $_[KERNEL]->post(myserver => 'shutdown') if $replies == 10;
46 },
47 ClientPreConnect => sub
48 {
49 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
50 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
51 ok(!$@, "SERVER: SSLify_Options $@");
52
53 my $socket = eval { Server_SSLify($_[ARG0]) };
54 ok(!$@, "SERVER: Server_SSLify $@");
55 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
56
57 # We pray that IO::Handle is sane...
58 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
59
60 return ($socket);
61 },
62 ClientInput => sub
63 {
64 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
65
66 if ( $line eq 'ping' ) {
67 ok(1, "SERVER: recv: $line");
68
69 ## At this point, connection MUST be encrypted.
70 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
71 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
72
73 $heap->{client}->put('pong');
74 } else {
75 die "Unknown line from CLIENT: $line";
76 }
77 },
78 ClientError => sub
79 {
80 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
81 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
82 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
83
84 # TODO are there other "errors" that is harmless?
85 $error = "Normal disconnection" unless $error;
86 my $msg = "Got SERVER $syscall error $errno: $error";
87 unless ( $syscall eq 'read' and $errno == 0 ) {
88 fail( $msg );
89 } else {
90 diag( $msg ) if $ENV{TEST_VERBOSE};
91 }
92 },
93 );
94
95 POE::Component::Client::TCP->new
96 (
97 Alias => 'myclient',
98 RemoteAddress => '127.0.0.1',
99 RemotePort => $port,
100
101 Connected => sub
102 {
103 ok(1, 'CLIENT: connected');
104
105 $_[HEAP]->{server}->put('ping');
106 },
107 PreConnect => sub
108 {
109 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
110 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
111 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
112 ok(!$@, "CLIENT: Client_SSLify $@");
113 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
114
115 # We pray that IO::Handle is sane...
116 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
117
118 return ($socket);
119 },
120 ServerInput => sub
121 {
122 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
123
124 if ($line eq 'pong') {
125 ok(1, "CLIENT: recv: $line");
126
127 ## At this point, connection MUST be encrypted.
128 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
129 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
130 diag( Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $heap->{server}->get_output_handle ) ) ) if $ENV{TEST_VERBOSE};
131 $replies++;
132 $kernel->yield('shutdown');
133 } else {
134 die "Unknown line from SERVER: $line";
135 }
136 },
137 ServerError => sub
138 {
139 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
140 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
141 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
142
143 # TODO are there other "errors" that is harmless?
144 $error = "Normal disconnection" unless $error;
145 my $msg = "Got CLIENT $syscall error $errno: $error";
146 unless ( $syscall eq 'read' and $errno == 0 ) {
147 fail( $msg );
148 } else {
149 diag( $msg ) if $ENV{TEST_VERBOSE};
150 }
151 },
152 ) for 1 .. 10;
153
154 $poe_kernel->run();
155
156 is( $replies, 10, "Make sure we got 10 replies back!" );
157
158 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This is an extension of the simple_parallel.t test to test for large responses
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25 my $replies = 0;
26
27 my $bigpacket = join( '-', ('a' .. 'z') x 10000, ('A' .. 'Z') x 10000 ) x 2;
28
29 POE::Component::Server::TCP->new
30 (
31 Alias => 'myserver',
32 Address => '127.0.0.1',
33 Port => 0,
34 ClientFilter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
35 Started => sub
36 {
37 use Socket qw/sockaddr_in/;
38 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
39 },
40 ClientConnected => sub
41 {
42 ok(1, 'SERVER: accepted');
43 },
44 ClientDisconnected => sub
45 {
46 ok(1, 'SERVER: client disconnected');
47 $_[KERNEL]->post(myserver => 'shutdown') if $replies == 10;
48 },
49 ClientPreConnect => sub
50 {
51 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
52 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
53 ok(!$@, "SERVER: SSLify_Options $@");
54
55 my $socket = eval { Server_SSLify($_[ARG0]) };
56 ok(!$@, "SERVER: Server_SSLify $@");
57 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
58
59 # We pray that IO::Handle is sane...
60 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
61
62 return ($socket);
63 },
64 ClientInput => sub
65 {
66 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
67
68 if ( $line eq $bigpacket ) {
69 ## At this point, connection MUST be encrypted.
70 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
71 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
72
73 $heap->{client}->put($bigpacket);
74 } else {
75 die "Unknown line from CLIENT: $line";
76 }
77 },
78 ClientError => sub
79 {
80 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
81 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
82 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
83
84 # TODO are there other "errors" that is harmless?
85 $error = "Normal disconnection" unless $error;
86 my $msg = "Got SERVER $syscall error $errno: $error";
87 unless ( $syscall eq 'read' and $errno == 0 ) {
88 fail( $msg );
89 } else {
90 diag( $msg ) if $ENV{TEST_VERBOSE};
91 }
92 },
93 );
94
95 POE::Component::Client::TCP->new
96 (
97 Alias => 'myclient',
98 RemoteAddress => '127.0.0.1',
99 RemotePort => $port,
100 Filter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
101 Connected => sub
102 {
103 ok(1, 'CLIENT: connected');
104
105 $_[HEAP]->{server}->put($bigpacket);
106 },
107 PreConnect => sub
108 {
109 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
110 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
111 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
112 ok(!$@, "CLIENT: Client_SSLify $@");
113 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
114
115 # We pray that IO::Handle is sane...
116 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
117
118 return ($socket);
119 },
120 ServerInput => sub
121 {
122 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
123
124 if ($line eq $bigpacket) {
125 ## At this point, connection MUST be encrypted.
126 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
127 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
128 diag( Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $heap->{server}->get_output_handle ) ) ) if $ENV{TEST_VERBOSE};
129 $replies++;
130 $kernel->yield('shutdown');
131 } else {
132 die "Unknown line from SERVER: $line";
133 }
134 },
135 ServerError => sub
136 {
137 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
138 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
139 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
140
141 # TODO are there other "errors" that is harmless?
142 $error = "Normal disconnection" unless $error;
143 my $msg = "Got CLIENT $syscall error $errno: $error";
144 unless ( $syscall eq 'read' and $errno == 0 ) {
145 fail( $msg );
146 } else {
147 diag( $msg ) if $ENV{TEST_VERBOSE};
148 }
149 },
150 ) for 1 .. 10;
151
152 $poe_kernel->run();
153
154 is( $replies, 10, "Make sure we got 10 replies back!" );
155
156 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This is an extension of the simple_parallel_large.t test for even LARGER message sizes!
13 # and thus is marked as TODO and a watchdog timer of 2m is set in case we lock up - see RT#95071
14
15 use Test::FailWarnings;
16 use Test::More 1.001002; # new enough for sanity in done_testing()
17
18 BEGIN {
19 eval 'use IO::Prompt::Tiny qw/prompt/; my $ans = prompt("This is a long test, do you want to run it? (y/n)", ($ENV{"AUTOMATED_TESTING"} ? "y" : "n")); die "NO" if $ans ne "y";';
20 if ( $@ ) {
21 plan skip_all => "AUTHOR TEST: $@";
22 }
23 }
24
25 use POE 1.267;
26 use POE::Component::Client::TCP;
27 use POE::Component::Server::TCP;
28 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
29
30 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
31
32 my $port;
33 my $replies = 0;
34
35 # TODO interestingly, x3 goes over some sort of buffer size and this explodes!
36 my $bigpacket = join( '-', ('a' .. 'z') x 10000, ('A' .. 'Z') x 10000 ) x 10;
37
38 POE::Component::Server::TCP->new
39 (
40 Alias => 'myserver',
41 Address => '127.0.0.1',
42 Port => 0,
43 ClientFilter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
44 Started => sub
45 {
46 use Socket qw/sockaddr_in/;
47 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
48 },
49 ClientConnected => sub
50 {
51 ok(1, 'SERVER: accepted');
52 },
53 ClientDisconnected => sub
54 {
55 ok(1, 'SERVER: client disconnected');
56 $_[KERNEL]->post(myserver => 'shutdown') if $replies == 10;
57 },
58 ClientPreConnect => sub
59 {
60 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
61 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
62 ok(!$@, "SERVER: SSLify_Options $@");
63
64 my $socket = eval { Server_SSLify($_[ARG0]) };
65 ok(!$@, "SERVER: Server_SSLify $@");
66 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
67
68 # We pray that IO::Handle is sane...
69 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
70
71 return ($socket);
72 },
73 ClientInput => sub
74 {
75 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
76
77 if ( $line eq $bigpacket ) {
78 ## At this point, connection MUST be encrypted.
79 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
80 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
81
82 $heap->{client}->put($bigpacket);
83 } else {
84 die "Unknown line from CLIENT: $line";
85 }
86 },
87 ClientError => sub
88 {
89 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
90 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
91 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
92
93 # TODO are there other "errors" that is harmless?
94 $error = "Normal disconnection" unless $error;
95 my $msg = "Got SERVER $syscall error $errno: $error";
96 unless ( $syscall eq 'read' and $errno == 0 ) {
97 fail( $msg );
98 } else {
99 diag( $msg ) if $ENV{TEST_VERBOSE};
100 }
101 },
102 );
103
104 POE::Component::Client::TCP->new
105 (
106 Alias => 'myclient',
107 RemoteAddress => '127.0.0.1',
108 RemotePort => $port,
109 Filter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
110 Connected => sub
111 {
112 ok(1, 'CLIENT: connected');
113
114 $_[HEAP]->{server}->put($bigpacket);
115 },
116 PreConnect => sub
117 {
118 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
119 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
120 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
121 ok(!$@, "CLIENT: Client_SSLify $@");
122 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
123
124 # We pray that IO::Handle is sane...
125 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
126
127 return ($socket);
128 },
129 ServerInput => sub
130 {
131 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
132
133 if ($line eq $bigpacket) {
134 ## At this point, connection MUST be encrypted.
135 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
136 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
137 diag( Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $heap->{server}->get_output_handle ) ) ) if $ENV{TEST_VERBOSE};
138 $replies++;
139 $kernel->yield('shutdown');
140 } else {
141 die "Unknown line from SERVER: $line";
142 }
143 },
144 ServerError => sub
145 {
146 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
147 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
148 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
149
150 # TODO are there other "errors" that is harmless?
151 $error = "Normal disconnection" unless $error;
152 my $msg = "Got CLIENT $syscall error $errno: $error";
153 unless ( $syscall eq 'read' and $errno == 0 ) {
154 fail( $msg );
155 } else {
156 diag( $msg ) if $ENV{TEST_VERBOSE};
157 }
158 },
159 ) for 1 .. 10;
160
161 # the watchdog session
162 POE::Session->create(
163 inline_states => {
164 _start => sub { $_[KERNEL]->delay( 'dog' => 300 ); $_[KERNEL]->yield( 'check' ); },
165 dog => sub { fail "WATCHDOG TRIGGERED"; done_testing; exit; },
166 check => sub { $_[KERNEL]->delay( 'check' => 1 ); $_[KERNEL]->alarm_remove_all if $replies == 10; },
167 },
168 );
169
170 $poe_kernel->run();
171
172 is( $replies, 10, "Make sure we got 10 replies back!" );
173
174 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This is an extension of the simple_large.t test for even LARGER message sizes!
13 # and thus is marked as TODO and a watchdog timer is set in case we lock up - see RT#95071
14
15 use Test::FailWarnings;
16 use Test::More 1.001002; # new enough for sanity in done_testing()
17
18 BEGIN {
19 eval 'use IO::Prompt::Tiny qw/prompt/; my $ans = prompt("This is a long test, do you want to run it? (y/n)", ($ENV{"AUTOMATED_TESTING"} ? "y" : "n")); die "NO" if $ans ne "y";';
20 if ( $@ ) {
21 plan skip_all => "AUTHOR TEST: $@";
22 }
23 }
24
25 use POE 1.267;
26 use POE::Component::Client::TCP;
27 use POE::Component::Server::TCP;
28 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket SSLify_GetSSL/;
29
30 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
31
32 my $port;
33
34 # TODO interestingly, x3 goes over some sort of buffer size and this explodes!
35 my $bigpacket = join( '-', ('a' .. 'z') x 10000, ('A' .. 'Z') x 10000 ) x 10;
36
37 POE::Component::Server::TCP->new
38 (
39 Alias => 'myserver',
40 Address => '127.0.0.1',
41 Port => 0,
42 ClientFilter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
43 Started => sub
44 {
45 use Socket qw/sockaddr_in/;
46 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
47 },
48 ClientConnected => sub
49 {
50 ok(1, 'SERVER: accepted');
51 },
52 ClientDisconnected => sub
53 {
54 ok(1, 'SERVER: client disconnected');
55 $_[KERNEL]->post(myserver => 'shutdown');
56 },
57 ClientPreConnect => sub
58 {
59 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
60 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
61 ok(!$@, "SERVER: SSLify_Options $@");
62
63 my $socket = eval { Server_SSLify($_[ARG0]) };
64 ok(!$@, "SERVER: Server_SSLify $@");
65 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
66
67 # We pray that IO::Handle is sane...
68 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
69
70 return ($socket);
71 },
72 ClientInput => sub
73 {
74 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
75
76 if ( $line eq $bigpacket ) {
77 ok(1, "SERVER: recv BIGPACKET");
78
79 ## At this point, connection MUST be encrypted.
80 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
81 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
82
83 $heap->{client}->put($bigpacket);
84 } else {
85 die "Unknown line from CLIENT: $line";
86 }
87 },
88 ClientError => sub
89 {
90 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
91 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
92 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
93
94 # TODO are there other "errors" that is harmless?
95 $error = "Normal disconnection" unless $error;
96 my $msg = "Got SERVER $syscall error $errno: $error";
97 unless ( $syscall eq 'read' and $errno == 0 ) {
98 fail( $msg );
99 } else {
100 diag( $msg ) if $ENV{TEST_VERBOSE};
101 }
102 },
103 );
104
105 my $replies = 0;
106
107 POE::Component::Client::TCP->new
108 (
109 Alias => 'myclient',
110 RemoteAddress => '127.0.0.1',
111 RemotePort => $port,
112 Filter => ['POE::Filter::Block', 'BlockSize' => length $bigpacket],
113 Connected => sub
114 {
115 ok(1, 'CLIENT: connected');
116
117 $_[HEAP]->{server}->put($bigpacket);
118 },
119 PreConnect => sub
120 {
121 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
122 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
123 my $socket = eval { Client_SSLify($_[ARG0], undef, undef, $ctx) };
124 ok(!$@, "CLIENT: Client_SSLify $@");
125 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
126
127 # We pray that IO::Handle is sane...
128 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
129
130 return ($socket);
131 },
132 ServerInput => sub
133 {
134 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
135
136 if ($line eq $bigpacket) {
137 ok(1, "CLIENT: recv BIGPACKET");
138
139 ## At this point, connection MUST be encrypted.
140 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
141 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
142 diag( Net::SSLeay::dump_peer_certificate( SSLify_GetSSL( $heap->{server}->get_output_handle ) ) ) if $ENV{TEST_VERBOSE};
143 $replies++;
144 $kernel->yield('shutdown');
145 } else {
146 die "Unknown line from SERVER: $line";
147 }
148 },
149 ServerError => sub
150 {
151 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
152 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
153 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
154
155 # TODO are there other "errors" that is harmless?
156 $error = "Normal disconnection" unless $error;
157 my $msg = "Got CLIENT $syscall error $errno: $error";
158 unless ( $syscall eq 'read' and $errno == 0 ) {
159 fail( $msg );
160 } else {
161 diag( $msg ) if $ENV{TEST_VERBOSE};
162 }
163 },
164 );
165
166 # the watchdog session
167 POE::Session->create(
168 inline_states => {
169 _start => sub { $_[KERNEL]->delay( 'dog' => 300 ); $_[KERNEL]->yield( 'check' ); },
170 dog => sub { fail "WATCHDOG TRIGGERED"; done_testing; exit; },
171 check => sub { $_[KERNEL]->delay( 'check' => 1 ); $_[KERNEL]->alarm_remove_all if $replies == 1 },
172 },
173 );
174
175 $poe_kernel->run();
176
177 done_testing;
0 #!/usr/bin/perl
1 #
2 # This file is part of POE-Component-SSLify
3 #
4 # This software is copyright (c) 2014 by Apocalypse.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 use strict; use warnings;
10 use strict; use warnings;
11
12 # This tests in-situ sslification ( upgrade a non-ssl socket to ssl )
13
14 use Test::FailWarnings;
15 use Test::More 1.001002; # new enough for sanity in done_testing()
16
17 use POE 1.267;
18 use POE::Component::Client::TCP;
19 use POE::Component::Server::TCP;
20 use POE::Component::SSLify qw/Client_SSLify Server_SSLify SSLify_Options SSLify_GetCipher SSLify_ContextCreate SSLify_GetSocket/;
21
22 # TODO rewrite this to use Test::POE::Server::TCP and stuff :)
23
24 my $port;
25
26 POE::Component::Server::TCP->new
27 (
28 Alias => 'myserver',
29 Address => '127.0.0.1',
30 Port => 0,
31
32 Started => sub
33 {
34 use Socket qw/sockaddr_in/;
35 $port = (sockaddr_in($_[HEAP]->{listener}->getsockname))[0];
36 },
37 ClientConnected => sub
38 {
39 ok(1, 'SERVER: accepted');
40 },
41 ClientDisconnected => sub
42 {
43 ok(1, 'SERVER: client disconnected');
44 $_[KERNEL]->post(myserver => 'shutdown');
45 },
46 ClientInput => sub
47 {
48 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
49
50 if ( $line eq 'plaintext_ping' ) {
51 ok(1, "SERVER: recv: $line");
52 $heap->{client}->put('plaintext_pong');
53 $heap->{client}->flush; # make sure we sent the pong
54
55 # sslify it in-situ!
56 eval { SSLify_Options('mylib/example.key', 'mylib/example.crt', 'sslv3') };
57 eval { SSLify_Options('../mylib/example.key', '../mylib/example.crt', 'sslv3') } if ($@);
58 ok(!$@, "SERVER: SSLify_Options $@");
59 my $socket = eval { Server_SSLify($heap->{client}->get_output_handle) };
60 ok(!$@, "SERVER: Server_SSLify $@");
61 ok(1, 'SERVER: SSLify_GetCipher: '. SSLify_GetCipher($socket));
62
63 # We pray that IO::Handle is sane...
64 ok( SSLify_GetSocket( $socket )->blocking == 0, 'SERVER: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
65
66 # TODO evil code here, ha!
67 # Should I ask rcaputo to add a $rw->replace_handle($socket) method?
68 # if you don't do the undef and just replace it - you'll get a bad file descriptor error from POE!
69 # <fh> select error: Bad file descriptor (hits=-1)
70 undef $heap->{client};
71 $heap->{client} = POE::Wheel::ReadWrite->new(
72 Handle => $socket,
73 InputEvent => 'tcp_server_got_input',
74 ErrorEvent => 'tcp_server_got_error',
75 FlushedEvent => 'tcp_server_got_flush',
76 );
77 } elsif ( $line eq 'ssl_ping' ) {
78 ok(1, "SERVER: recv: $line");
79
80 ## At this point, connection MUST be encrypted.
81 my $cipher = SSLify_GetCipher($heap->{client}->get_output_handle);
82 ok($cipher ne '(NONE)', "SERVER: SSLify_GetCipher: $cipher");
83
84 $heap->{client}->put('ssl_pong');
85 } else {
86 die "Unknown line from CLIENT: $line";
87 }
88 },
89 ClientError => sub
90 {
91 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
92 # The default PoCo::Server::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
93 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
94
95 # TODO are there other "errors" that is harmless?
96 $error = "Normal disconnection" unless $error;
97 my $msg = "Got SERVER $syscall error $errno: $error";
98 unless ( $syscall eq 'read' and $errno == 0 ) {
99 fail( $msg );
100 } else {
101 diag( $msg ) if $ENV{TEST_VERBOSE};
102 }
103 },
104 );
105
106 POE::Component::Client::TCP->new
107 (
108 Alias => 'myclient',
109 RemoteAddress => '127.0.0.1',
110 RemotePort => $port,
111
112 Connected => sub
113 {
114 ok(1, 'CLIENT: connected');
115
116 $_[HEAP]->{server}->put("plaintext_ping");
117 },
118 ServerInput => sub
119 {
120 my ($kernel, $heap, $line) = @_[KERNEL, HEAP, ARG0];
121
122 if ( $line eq 'plaintext_pong' ) {
123 ok(1, "CLIENT: recv: $line");
124
125 # sslify it in-situ!
126 my $ctx = eval { SSLify_ContextCreate(undef, undef, 'sslv3') };
127 ok(!$@, "CLIENT: SSLify_ContextCreate $@");
128 my $socket = eval { Client_SSLify($heap->{server}->get_output_handle, undef, undef, $ctx) };
129 ok(!$@, "CLIENT: Client_SSLify $@");
130 ok(1, 'CLIENT: SSLify_GetCipher: '. SSLify_GetCipher($socket));
131
132 # We pray that IO::Handle is sane...
133 ok( SSLify_GetSocket( $socket )->blocking == 0, 'CLIENT: SSLified socket is non-blocking?') if $^O ne 'MSWin32';
134
135 # TODO evil code here, ha!
136 # Should I ask rcaputo to add a $rw->replace_handle($socket) method?
137 # if you don't do the undef and just replace it - you'll get a bad file descriptor error from POE!
138 # <fh> select error: Bad file descriptor (hits=-1)
139 undef $heap->{server};
140 $heap->{server} = POE::Wheel::ReadWrite->new(
141 Handle => $socket,
142 InputEvent => 'got_server_input',
143 ErrorEvent => 'got_server_error',
144 FlushedEvent => 'got_server_flush',
145 );
146
147 # Send the ssl ping!
148 $heap->{server}->put('ssl_ping');
149 } elsif ( $line eq 'ssl_pong' ) {
150 ok(1, "CLIENT: recv: $line");
151
152 ## At this point, connection MUST be encrypted.
153 my $cipher = SSLify_GetCipher($heap->{server}->get_output_handle);
154 ok($cipher ne '(NONE)', "CLIENT: SSLify_GetCipher: $cipher");
155
156 $kernel->yield('shutdown');
157 } else {
158 die "Unknown line from SERVER: $line";
159 }
160 },
161 ServerError => sub
162 {
163 # Thanks to H. Merijn Brand for spotting this FAIL in 5.12.0!
164 # The default PoCo::Client::TCP handler will throw a warning, which causes Test::NoWarnings to FAIL :(
165 my ($syscall, $errno, $error) = @_[ ARG0..ARG2 ];
166
167 # TODO are there other "errors" that is harmless?
168 $error = "Normal disconnection" unless $error;
169 my $msg = "Got CLIENT $syscall error $errno: $error";
170 unless ( $syscall eq 'read' and $errno == 0 ) {
171 fail( $msg );
172 } else {
173 diag( $msg ) if $ENV{TEST_VERBOSE};
174 }
175 },
176 );
177
178 $poe_kernel->run();
179
180 done_testing;