« blib/lib/Cassandra/Client/ResultSet.pm
↑ Summary
blib/lib/Cassandra/Client/Error/ReadTimeoutException.pm »
| 1 | package Cassandra::Client::TLSHandling; | ||||||||||
| 2 | 13 | our $AUTHORITY = 'cpan:TVDW'; | |||||||||
| 3 | 13 | $Cassandra::Client::TLSHandling::VERSION = '0.21'; | |||||||||
| 4 | 13 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 13 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 13 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | # SSLeay needs initialization | ||||||||||
| 9 | 13 | ▶ | use Net::SSLeay 1.63 qw/die_now MODE_ENABLE_PARTIAL_WRITE MODE_ACCEPT_MOVING_WRITE_BUFFER/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 13 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 13 | Net::SSLeay::load_error_strings(); | |||||||||
| 12 | 13 | Net::SSLeay::SSLeay_add_ssl_algorithms(); | |||||||||
| 13 | 13 | Net::SSLeay::randomize(); | |||||||||
| 14 | } | ||||||||||
| 15 | |||||||||||
| 16 | 13 | ▶ | use Devel::GlobalDestruction; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 19 | 0 | my ($class)= @_; | |||||||||
| 20 | |||||||||||
| 21 | 0 | ▶ | my $ctx= Net::SSLeay::CTX_new() or die_now("Unable to create OpenSSL context"); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 0 | my $self= bless \$ctx, $class; | |||||||||
| 23 | |||||||||||
| 24 | 0 | Net::SSLeay::CTX_set_options($$self, Net::SSLeay::OP_ALL() | Net::SSLeay::OP_NO_SSLv2() | Net::SSLeay::OP_NO_SSLv3()); | |||||||||
| 25 | 0 | Net::SSLeay::CTX_set_mode($$self, MODE_ENABLE_PARTIAL_WRITE | MODE_ACCEPT_MOVING_WRITE_BUFFER); | |||||||||
| 26 | 0 | return $self; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 0 | ▶ | sub new_conn { | ||||||||
|
Subroutine
new_conn: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 30 | 0 | my ($self)= @_; | |||||||||
| 31 | 0 | ▶ | my $tls= Net::SSLeay::new($$self) or die_now("Unable to create OpenSSL SSL object"); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | return bless \$tls, "Cassandra::Client::TLSHandling::conn"; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | sub DESTROY { | ||||||||
|
Subroutine
DESTROY: not called CC=2 SCAR=17.9
| |||||||||||
| 36 | 0 | local $@; | |||||||||
| 37 | 0 | ▶ | return if in_global_destruction; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | |||||||||||
| 39 | 0 | my $self= shift; | |||||||||
| 40 | |||||||||||
| 41 | 0 | Net::SSLeay::CTX_free($$self); | |||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 13 | 1; | |||||||||
| 45 | |||||||||||
| 46 | package Cassandra::Client::TLSHandling::conn; | ||||||||||
| 47 | 13 | our $AUTHORITY = 'cpan:TVDW'; | |||||||||
| 48 | 13 | $Cassandra::Client::TLSHandling::conn::VERSION = '0.21'; | |||||||||
| 49 | 13 | ▶ | use 5.010; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 50 | 13 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 51 | 13 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 52 | |||||||||||
| 53 | 13 | ▶ | use Devel::GlobalDestruction; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 54 | |||||||||||
| 55 | 0 | ▶ | sub DESTROY { | ||||||||
|
Subroutine
DESTROY: not called CC=2 SCAR=17.9
| |||||||||||
| 56 | 0 | local $@; | |||||||||
| 57 | 0 | ▶ | return if in_global_destruction; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 58 | |||||||||||
| 59 | 0 | my $self= shift; | |||||||||
| 60 | 0 | Net::SSLeay::free($$self); | |||||||||
| 61 | } | ||||||||||
| 62 | |||||||||||
| 63 | 13 | 1; | |||||||||
| 64 | |||||||||||
| 65 | __END__ | ||||||||||