Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 88
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 218
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 219
Warning: Cannot modify header information - headers already sent by (output started at /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php:88) in /home/afelisqd/cppseducation.sc.tz/admin/images/photos/17587263121019776732_admin-dbb.php on line 220
PK ! V~* * Handle.pmnu [ package Net::SSLeay::Handle;
use 5.8.1;
use strict;
use Socket;
use Net::SSLeay;
require Exporter;
=encoding utf-8
=head1 NAME
Net::SSLeay::Handle - Perl module that lets SSL (HTTPS) sockets be
handled as standard file handles.
=head1 SYNOPSIS
use Net::SSLeay::Handle qw/shutdown/;
my ($host, $port) = ("localhost", 443);
tie(*SSL, "Net::SSLeay::Handle", $host, $port);
print SSL "GET / HTTP/1.0\r\n";
shutdown(\*SSL, 1);
print while ();
close SSL;
=head1 DESCRIPTION
Net::SSLeay::Handle allows you to request and receive HTTPS web pages
using "old-fashion" file handles as in:
print SSL "GET / HTTP/1.0\r\n";
and
print while ();
If you export the shutdown routine, then the only extra code that
you need to add to your program is the tie function as in:
my $socket;
if ($scheme eq "https") {
tie(*S2, "Net::SSLeay::Handle", $host, $port);
$socket = \*S2;
else {
$socket = Net::SSLeay::Handle->make_socket($host, $port);
}
print $socket $request_headers;
...
=cut
use vars qw(@ISA @EXPORT_OK $VERSION);
@ISA = qw(Exporter);
@EXPORT_OK = qw(shutdown);
$VERSION = '1.88';
my $Initialized; #-- only _initialize() once
my $Debug = 0; #-- pretty hokey
#== Tie Handle Methods ========================================================
#
# see perldoc perltie for details.
#
#==============================================================================
sub TIEHANDLE {
my ($class, $socket, $port) = @_;
$Debug > 10 and print "TIEHANDLE(@{[join ', ', @_]})\n";
ref $socket eq "GLOB" or $socket = $class->make_socket($socket, $port);
$class->_initialize();
my $ctx = Net::SSLeay::CTX_new() or die_now("Failed to create SSL_CTX $!");
my $ssl = Net::SSLeay::new($ctx) or die_now("Failed to create SSL $!");
my $fileno = fileno($socket);
Net::SSLeay::set_fd($ssl, $fileno); # Must use fileno
my $resp = Net::SSLeay::connect($ssl);
$Debug and print "Cipher '" . Net::SSLeay::get_cipher($ssl) . "'\n";
my $self = bless {
ssl => $ssl,
ctx => $ctx,
socket => $socket,
fileno => $fileno,
}, $class;
return $self;
}
sub PRINT {
my $self = shift;
my $ssl = _get_ssl($self);
my $resp = 0;
for my $msg (@_) {
defined $msg or last;
$resp = Net::SSLeay::write($ssl, $msg) or last;
}
return $resp;
}
sub READLINE {
my $self = shift;
my $ssl = _get_ssl($self);
if (wantarray) {
my @lines;
while (my $line = Net::SSLeay::ssl_read_until($ssl)) {
push @lines, $line;
}
return @lines;
} else {
my $line = Net::SSLeay::ssl_read_until($ssl);
return $line ? $line : undef;
}
}
sub READ {
my ($self, $buf, $len, $offset) = \ (@_);
my $ssl = _get_ssl($$self);
defined($$offset) or
return length($$buf = Net::SSLeay::ssl_read_all($ssl, $$len));
defined(my $read = Net::SSLeay::ssl_read_all($ssl, $$len))
or return undef;
my $buf_len = length($$buf);
$$offset > $buf_len and $$buf .= chr(0) x ($$offset - $buf_len);
substr($$buf, $$offset) = $read;
return length($read);
}
sub WRITE {
my $self = shift;
my ($buf, $len, $offset) = @_;
$offset = 0 unless defined $offset;
# Return number of characters written.
my $ssl = $self->_get_ssl();
return $len if Net::SSLeay::write($ssl, substr($buf, $offset, $len));
return undef;
}
sub CLOSE {
my $self = shift;
my $fileno = $self->{fileno};
$Debug > 10 and print "close($fileno)\n";
Net::SSLeay::free ($self->{ssl});
Net::SSLeay::CTX_free ($self->{ctx});
close $self->{socket};
}
sub FILENO { $_[0]->{fileno} }
=head1 FUNCTIONS
=over
=item shutdown
shutdown(\*SOCKET, $mode)
Calls to the main shutdown() don't work with tied sockets created with this
module. This shutdown should be able to distinquish between tied and untied
sockets and do the right thing.
=cut
sub shutdown {
my ($obj, @params) = @_;
my $socket = UNIVERSAL::isa($obj, 'Net::SSLeay::Handle') ?
$obj->{socket} : $obj;
return shutdown($socket, @params);
}
=item debug
my $debug = Net::SSLeay::Handle->debug()
Net::SSLeay::Handle->debug(1)
Get/set debugging mode. Always returns the debug value before the function call.
if an additional argument is given the debug option will be set to this value.
=cut
sub debug {
my ($class, $debug) = @_;
my $old_debug = $Debug;
@_ >1 and $Debug = $debug || 0;
return $old_debug;
}
#=== Internal Methods =========================================================
=item make_socket
my $sock = Net::SSLeay::Handle->make_socket($host, $port);
Creates a socket that is connected to $post using $port. It uses
$Net::SSLeay::proxyhost and proxyport if set and authentificates itself against
this proxy depending on $Net::SSLeay::proxyauth. It also turns autoflush on for
the created socket.
=cut
sub make_socket {
my ($class, $host, $port) = @_;
$Debug > 10 and print "_make_socket(@{[join ', ', @_]})\n";
$host ||= 'localhost';
$port ||= 443;
my $phost = $Net::SSLeay::proxyhost;
my $pport = $Net::SSLeay::proxyhost ? $Net::SSLeay::proxyport : $port;
my $dest_ip = gethostbyname($phost || $host);
my $host_params = sockaddr_in($pport, $dest_ip);
socket(my $socket, &PF_INET(), &SOCK_STREAM(), 0) or die "socket: $!";
connect($socket, $host_params) or die "connect: $!";
my $old_select = select($socket); $| = 1; select($old_select);
$phost and do {
my $auth = $Net::SSLeay::proxyauth;
my $CRLF = $Net::SSLeay::CRLF;
print $socket "CONNECT $host:$port HTTP/1.0$auth$CRLF$CRLF";
my $line = <$socket>;
};
return $socket;
}
=back
=cut
sub _initialize {
$Initialized++ and return;
Net::SSLeay::load_error_strings();
Net::SSLeay::SSLeay_add_ssl_algorithms();
Net::SSLeay::randomize();
}
sub __dummy {
my $host = $Net::SSLeay::proxyhost;
my $port = $Net::SSLeay::proxyport;
my $auth = $Net::SSLeay::proxyauth;
}
#--- _get_self($socket) -------------------------------------------------------
# Returns a hash containing attributes for $socket (= \*SOMETHING) based
# on fileno($socket). Will return undef if $socket was not created here.
#------------------------------------------------------------------------------
sub _get_self { return $_[0]; }
#--- _get_ssl($socket) --------------------------------------------------------
# Returns a the "ssl" attribute for $socket (= \*SOMETHING) based
# on fileno($socket). Will cause a warning and return undef if $socket was not
# created here.
#------------------------------------------------------------------------------
sub _get_ssl {
return $_[0]->{ssl};
}
1;
__END__
=head2 USING EXISTING SOCKETS
One of the motivations for writing this module was to avoid
duplicating socket creation code (which is mostly error handling).
The calls to tie() above where it is passed a $host and $port is
provided for convenience testing. If you already have a socket
connected to the right host and port, S1, then you can do something
like:
my $socket \*S1;
if ($scheme eq "https") {
tie(*S2, "Net::SSLeay::Handle", $socket);
$socket = \*S2;
}
my $last_sel = select($socket); $| = 1; select($last_sel);
print $socket $request_headers;
...
Note: As far as I know you must be careful with the globs in the tie()
function. The first parameter must be a glob (*SOMETHING) and the
last parameter must be a reference to a glob (\*SOMETHING_ELSE) or a
scaler that was assigned to a reference to a glob (as in the example
above)
Also, the two globs must be different. When I tried to use the same
glob, I got a core dump.
=head2 EXPORT
None by default.
You can export the shutdown() function.
It is suggested that you do export shutdown() or use the fully
qualified Net::SSLeay::Handle::shutdown() function to shutdown SSL
sockets. It should be smart enough to distinguish between SSL and
non-SSL sockets and do the right thing.
=head1 EXAMPLES
use Net::SSLeay::Handle qw/shutdown/;
my ($host, $port) = ("localhost", 443);
tie(*SSL, "Net::SSLeay::Handle", $host, $port);
print SSL "GET / HTTP/1.0\r\n";
shutdown(\*SSL, 1);
print while ();
close SSL;
=head1 TODO
Better error handling. Callback routine?
=head1 CAVEATS
Tying to a file handle is a little tricky (for me at least).
The first parameter to tie() must be a glob (*SOMETHING) and the last
parameter must be a reference to a glob (\*SOMETHING_ELSE) or a scaler
that was assigned to a reference to a glob ($s = \*SOMETHING_ELSE).
Also, the two globs must be different. When I tried to use the same
glob, I got a core dump.
I was able to associate attributes to globs created by this module
(like *SSL above) by making a hash of hashes keyed by the file head1.
=head1 CHANGES
Please see Net-SSLeay-Handle-0.50/Changes file.
=head1 BUGS
If you encounter a problem with this module that you believe is a bug,
please report it in one of the following ways:
=over
=item *
L
under the Net-SSLeay GitHub project at
L;
=item *
L using
the CPAN RT bug tracker's web interface at
L;
=item *
send an email to the CPAN RT bug tracker at
L.
=back
Please make sure your bug report includes the following information:
=over
=item * the code you are trying to run;
=item * your operating system name and version;
=item * the output of C;
=item * the version of OpenSSL or LibreSSL you are using.
=back
=head1 AUTHOR
Originally written by Jim Bowlin.
Maintained by Sampo Kellomäki between July 2001 and August 2003.
Maintained by Florian Ragwitz between November 2005 and January 2010.
Maintained by Mike McCauley between November 2005 and June 2018.
Maintained by Chris Novakovic, Tuure Vartiainen and Heikki Vatiainen since June 2018.
=head1 COPYRIGHT
Copyright (c) 2001 Jim Bowlin
Copyright (c) 2001-2003 Sampo Kellomäki
Copyright (c) 2005-2010 Florian Ragwitz
Copyright (c) 2005-2018 Mike McCauley
Copyright (c) 2018- Chris Novakovic
Copyright (c) 2018- Tuure Vartiainen
Copyright (c) 2018- Heikki Vatiainen
All rights reserved.
=head1 LICENSE
This module is released under the terms of the Artistic License 2.0. For
details, see the C file distributed with Net-SSLeay's source code.
=head1 SEE ALSO
Net::SSLeay, perl(1), http://openssl.org/
=cut
PK !
? ? make_headers.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1348 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/make_headers.al)"
sub make_headers {
my (@headers) = @_;
my $headers;
while (@headers) {
my $header = shift(@headers);
my $value = shift(@headers);
$header =~ s/:$//;
$value =~ s/\x0d?\x0a$//; # because we add it soon, see below
$headers .= "$header: $value$CRLF";
}
return $headers;
}
# end of Net::SSLeay::make_headers
1;
PK ! 2=\ \ make_form.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1331 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/make_form.al)"
###
### Easy https manipulation routines
###
sub make_form {
my (@fields) = @_;
my $form;
while (@fields) {
my ($name, $data) = (shift(@fields), shift(@fields));
$data =~ s/([^\w\-.\@\$ ])/sprintf("%%%2.2x",ord($1))/gse;
$data =~ tr[ ][+];
$form .= "$name=$data&";
}
chop $form;
return $form;
}
# end of Net::SSLeay::make_form
1;
PK ! &|? ?
head_httpx.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1467 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/head_httpx.al)"
sub head_httpx { do_httpx2(HEAD => @_) }
# end of Net::SSLeay::head_httpx
1;
PK ! sy dump_peer_certificate.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 945 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/dump_peer_certificate.al)"
### Quickly print out with whom we're talking
sub dump_peer_certificate ($) {
my ($ssl) = @_;
my $cert = get_peer_certificate($ssl);
return if print_errs('get_peer_certificate');
print "no cert defined\n" if !defined($cert);
# Cipher=NONE with empty cert fix
if (!defined($cert) || ($cert == 0)) {
warn "cert = `$cert'\n" if $trace;
return "Subject Name: undefined\nIssuer Name: undefined\n";
} else {
my $x = 'Subject Name: '
. X509_NAME_oneline(X509_get_subject_name($cert)) . "\n"
. 'Issuer Name: '
. X509_NAME_oneline(X509_get_issuer_name($cert)) . "\n";
Net::SSLeay::X509_free($cert);
return $x;
}
}
# end of Net::SSLeay::dump_peer_certificate
1;
PK ! ( D D post_https3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1436 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/post_https3.al)"
sub post_https3 { do_httpx3(POST => 1, @_) }
# end of Net::SSLeay::post_https3
1;
PK ! $Se e do_https4.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1426 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/do_https4.al)"
sub do_https4 { splice(@_,1,0) = 1; do_httpx4; } # Legacy undocumented
# https
# end of Net::SSLeay::do_https4
1;
PK ! ˰7? ? put_http3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1454 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/put_http3.al)"
sub put_http3 { do_httpx3(PUT => 0, @_) }
# end of Net::SSLeay::put_http3
1;
PK ! uo? ? get_http4.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1457 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/get_http4.al)"
sub get_http4 { do_httpx4(GET => 0, @_) }
# end of Net::SSLeay::get_http4
1;
PK ! u? ? get_http3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1452 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/get_http3.al)"
sub get_http3 { do_httpx3(GET => 0, @_) }
# end of Net::SSLeay::get_http3
1;
PK ! w"[/ / do_httpx2.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1401 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/do_httpx2.al)"
sub do_httpx2 {
my ($page, $response, $headers, $server_cert) = &do_httpx3;
X509_free($server_cert) if defined $server_cert;
return ($page, $response, defined $headers ?
map( { ($h,$v)=/^(\S+)\:\s*(.*)$/; (uc($h),$v); }
split(/\s?\n/, $headers)
) : ()
);
}
# end of Net::SSLeay::do_httpx2
1;
PK ! e e ssl_write_all.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 630 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/ssl_write_all.al)"
sub ssl_write_all {
my $ssl = $_[0];
my ($data_ref, $errs);
if (ref $_[1]) {
$data_ref = $_[1];
} else {
$data_ref = \$_[1];
}
my ($wrote, $written, $to_write) = (0,0, blength($$data_ref));
my $vm = $trace>2 && $linux_debug ?
(split ' ', `cat /proc/$$/stat`)[22] : 'vm_unknown';
warn " write_all VM at entry=$vm\n" if $trace>2;
while ($to_write) {
#sleep 1; # *** DEBUG
warn "partial `$$data_ref'\n" if $trace>3;
$wrote = write_partial($ssl, $written, $to_write, $$data_ref);
if (defined $wrote && ($wrote > 0)) { # write_partial can return -1
$written += $wrote;
$to_write -= $wrote;
} else {
if (defined $wrote) {
# check error conditions via SSL_get_error per man page
if ( my $sslerr = get_error($ssl, $wrote) ) {
my $errstr = ERR_error_string($sslerr);
my $errname = '';
SWITCH: {
$sslerr == constant("ERROR_NONE") && do {
# according to map page SSL_get_error(3ssl):
# The TLS/SSL I/O operation completed.
# This result code is returned if and only if ret > 0
# so if we received it here complain...
warn "ERROR_NONE unexpected with invalid return value!"
if $trace;
$errname = "SSL_ERROR_NONE";
};
$sslerr == constant("ERROR_WANT_READ") && do {
# operation did not complete, call again later, so do not
# set errname and empty err_que since this is a known
# error that is expected but, we should continue to try
# writing the rest of our data with same io call and params.
warn "ERROR_WANT_READ (TLS/SSL Handshake, will continue)\n"
if $trace;
print_errs('SSL_write(want read)');
last SWITCH;
};
$sslerr == constant("ERROR_WANT_WRITE") && do {
# operation did not complete, call again later, so do not
# set errname and empty err_que since this is a known
# error that is expected but, we should continue to try
# writing the rest of our data with same io call and params.
warn "ERROR_WANT_WRITE (TLS/SSL Handshake, will continue)\n"
if $trace;
print_errs('SSL_write(want write)');
last SWITCH;
};
$sslerr == constant("ERROR_ZERO_RETURN") && do {
# valid protocol closure from other side, no longer able to
# write, since there is no longer a session...
warn "ERROR_ZERO_RETURN($wrote): TLS/SSLv3 Closure alert\n"
if $trace;
$errname = "SSL_ERROR_ZERO_RETURN";
last SWITCH;
};
$sslerr == constant("ERROR_SSL") && do {
# library/protocol error
warn "ERROR_SSL($wrote): Library/Protocol error occured\n"
if $trace;
$errname = "SSL_ERROR_SSL";
last SWITCH;
};
$sslerr == constant("ERROR_WANT_CONNECT") && do {
# according to man page, should never happen on call to
# SSL_write, so complain, but handle as known error type
warn "ERROR_WANT_CONNECT: Unexpected error for SSL_write\n"
if $trace;
$errname = "SSL_ERROR_WANT_CONNECT";
last SWITCH;
};
$sslerr == constant("ERROR_WANT_ACCEPT") && do {
# according to man page, should never happen on call to
# SSL_write, so complain, but handle as known error type
warn "ERROR_WANT_ACCEPT: Unexpected error for SSL_write\n"
if $trace;
$errname = "SSL_ERROR_WANT_ACCEPT";
last SWITCH;
};
$sslerr == constant("ERROR_WANT_X509_LOOKUP") && do {
# operation did not complete: waiting on call back,
# call again later, so do not set errname and empty err_que
# since this is a known error that is expected but, we should
# continue to try writing the rest of our data with same io
# call parameter.
warn "ERROR_WANT_X509_LOOKUP: (Cert Callback asked for in ".
"SSL_write will contine)\n" if $trace;
print_errs('SSL_write(want x509');
last SWITCH;
};
$sslerr == constant("ERROR_SYSCALL") && do {
# some IO error occured. According to man page:
# Check retval, ERR, fallback to errno
if ($wrote==0) { # EOF
warn "ERROR_SYSCALL($wrote): EOF violates protocol.\n"
if $trace;
$errname = "SSL_ERROR_SYSCALL(EOF)";
} else { # -1 underlying BIO error reported.
# check error que for details, don't set errname since we
# are directly appending to errs
my $chkerrs = print_errs('SSL_write (syscall)');
if ($chkerrs) {
warn "ERROR_SYSCALL($wrote): Have errors\n" if $trace;
$errs .= "ssl_write_all $$: 1 - ERROR_SYSCALL($wrote,".
"$sslerr,$errstr,$!)\n$chkerrs";
} else { # que was empty, use errno
warn "ERROR_SYSCALL($wrote): errno($!)\n" if $trace;
$errs .= "ssl_write_all $$: 1 - ERROR_SYSCALL($wrote,".
"$sslerr) : $!\n";
}
}
last SWITCH;
};
warn "Unhandled val $sslerr from SSL_get_error(SSL,$wrote)\n"
if $trace;
$errname = "SSL_ERROR_?($sslerr)";
} # end of SWITCH block
if ($errname) { # if we had an errname set add the error
$errs .= "ssl_write_all $$: 1 - $errname($wrote,$sslerr,".
"$errstr,$!)\n";
}
} # endif on have SSL_get_error val
} # endif on $wrote defined
} # endelse on $wrote > 0
$vm = $trace>2 && $linux_debug ?
(split ' ', `cat /proc/$$/stat`)[22] : 'vm_unknown';
warn " written so far $wrote:$written bytes (VM=$vm)\n" if $trace>2;
# append remaining errors in que and report if errs exist
$errs .= print_errs('SSL_write');
return (wantarray ? (undef, $errs) : undef) if $errs;
}
return wantarray ? ($written, $errs) : $written;
}
# end of Net::SSLeay::ssl_write_all
1;
PK ! )v open_proxy_tcp_connection.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 547 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/open_proxy_tcp_connection.al)"
### Open connection via standard web proxy, if one was defined
### using set_proxy().
sub open_proxy_tcp_connection {
my ($dest_serv, $port) = @_;
return open_tcp_connection($dest_serv, $port) if !$proxyhost;
warn "Connect via proxy: $proxyhost:$proxyport" if $trace>2;
my ($ret, $errs) = open_tcp_connection($proxyhost, $proxyport);
return wantarray ? (0, $errs) : 0 if !$ret; # Connection fail
warn "Asking proxy to connect to $dest_serv:$port" if $trace>2;
#print SSLCAT_S "CONNECT $dest_serv:$port HTTP/1.0$proxyauth$CRLF$CRLF";
#my $line = ; # *** bug? Mixing stdio with syscall read?
($ret, $errs) =
tcp_write_all("CONNECT $dest_serv:$port HTTP/1.0$proxyauth$CRLF$CRLF");
return wantarray ? (0,$errs) : 0 if $errs;
($line, $errs) = tcp_read_until($CRLF . $CRLF, 1024);
warn "Proxy response: $line" if $trace>2;
return wantarray ? (0,$errs) : 0 if $errs;
return wantarray ? (1,'') : 1; # Success
}
# end of Net::SSLeay::open_proxy_tcp_connection
1;
PK ! |. . httpx_cat.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1291 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/httpx_cat.al)"
sub httpx_cat {
my ($usessl, $site, $port, $req, $crt_path, $key_path) = @_;
warn "httpx_cat: usessl=$usessl ($site:$port)" if $trace;
if ($usessl) {
return https_cat($site, $port, $req, $crt_path, $key_path);
} else {
return http_cat($site, $port, $req);
}
}
# end of Net::SSLeay::httpx_cat
1;
PK ! (< < set_cert_and_key.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1301 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/set_cert_and_key.al)"
###
### Easy set up of private key and certificate
###
sub set_cert_and_key ($$$) {
my ($ctx, $cert_path, $key_path) = @_;
my $errs = '';
# Following will ask password unless private key is not encrypted
CTX_use_PrivateKey_file( $ctx, $key_path, &FILETYPE_PEM ) == 1
or $errs .= print_errs("private key `$key_path' ($!)");
CTX_use_certificate_file ($ctx, $cert_path, &FILETYPE_PEM) == 1
or $errs .= print_errs("certificate `$cert_path' ($!)");
return wantarray ? (undef, $errs) : ($errs eq '');
}
# end of Net::SSLeay::set_cert_and_key
1;
PK ! =M tcp_write_all.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 771 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcp_write_all.al)"
sub tcp_write_all {
my ($data_ref, $errs);
if (ref $_[0]) {
$data_ref = $_[0];
} else {
$data_ref = \$_[0];
}
my ($wrote, $written, $to_write) = (0,0, blength($$data_ref));
my $vm = $trace>2 && $linux_debug ?
(split ' ', `cat /proc/$$/stat`)[22] : 'vm_unknown';
warn " write_all VM at entry=$vm to_write=$to_write\n" if $trace>2;
while ($to_write) {
warn "partial `$$data_ref'\n" if $trace>3;
$wrote = syswrite(SSLCAT_S, $$data_ref, $to_write, $written);
if (defined $wrote && ($wrote > 0)) { # write_partial can return -1
$written += $wrote;
$to_write -= $wrote;
} elsif (!defined($wrote)) {
warn "tcp_write_all: $!";
return (wantarray ? (undef, "$!") : undef);
}
$vm = $trace>2 && $linux_debug ?
(split ' ', `cat /proc/$$/stat`)[22] : 'vm_unknown';
warn " written so far $wrote:$written bytes (VM=$vm)\n" if $trace>2;
}
return wantarray ? ($written, '') : $written;
}
# end of Net::SSLeay::tcp_write_all
1;
PK ! nէ.E E head_https3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1438 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/head_https3.al)"
sub head_https3 { do_httpx3(HEAD => 1, @_) }
# end of Net::SSLeay::head_https3
1;
PK ! \ࡥ
debug_read.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 570 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/debug_read.al)"
###
### read and write helpers that block
###
sub debug_read {
my ($replyr, $gotr) = @_;
my $vm = $trace>2 && $linux_debug ?
(split ' ', `cat /proc/$$/stat`)[22] : 'vm_unknown';
warn " got " . blength($$gotr) . ':'
. blength($$replyr) . " bytes (VM=$vm).\n" if $trace == 3;
warn " got `$$gotr' (" . blength($$gotr) . ':'
. blength($$replyr) . " bytes, VM=$vm)\n" if $trace>3;
}
# end of Net::SSLeay::debug_read
1;
PK ! ㋫? ? get_https.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1430 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/get_https.al)"
sub get_https { do_httpx2(GET => 1, @_) }
# end of Net::SSLeay::get_https
1;
PK ! '%A A post_httpx4.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1475 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/post_httpx4.al)"
sub post_httpx4 { do_httpx4(POST => @_) }
# end of Net::SSLeay::post_httpx4
1;
PK ! 8 8
want_write.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 507 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/want_write.al)"
sub want_write { want(shift) == 3 }
# end of Net::SSLeay::want_write
1;
PK ! wFB B head_httpx3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1472 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/head_httpx3.al)"
sub head_httpx3 { do_httpx3(HEAD => @_) }
# end of Net::SSLeay::head_httpx3
1;
PK ! ? ?
put_httpx4.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1476 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/put_httpx4.al)"
sub put_httpx4 { do_httpx4(PUT => @_) }
# end of Net::SSLeay::put_httpx4
1;
PK ! .^ open_tcp_connection.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 515 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/open_tcp_connection.al)"
sub open_tcp_connection {
my ($dest_serv, $port) = @_;
my ($errs);
$port = getservbyname($port, 'tcp') unless $port =~ /^\d+$/;
my $dest_serv_ip = gethostbyname($dest_serv);
unless (defined($dest_serv_ip)) {
$errs = "$0 $$: open_tcp_connection: destination host not found:"
. " `$dest_serv' (port $port) ($!)\n";
warn $errs if $trace;
return wantarray ? (0, $errs) : 0;
}
my $sin = sockaddr_in($port, $dest_serv_ip);
warn "Opening connection to $dest_serv:$port (" .
inet_ntoa($dest_serv_ip) . ")" if $trace>2;
my $proto = &Socket::IPPROTO_TCP; # getprotobyname('tcp') not available on android
if (socket (SSLCAT_S, &PF_INET(), &SOCK_STREAM(), $proto)) {
warn "next connect" if $trace>3;
if (CORE::connect (SSLCAT_S, $sin)) {
my $old_out = select (SSLCAT_S); $| = 1; select ($old_out);
warn "connected to $dest_serv, $port" if $trace>3;
return wantarray ? (1, undef) : 1; # Success
}
}
$errs = "$0 $$: open_tcp_connection: failed `$dest_serv', $port ($!)\n";
warn $errs if $trace;
close SSLCAT_S;
return wantarray ? (0, $errs) : 0; # Fail
}
# end of Net::SSLeay::open_tcp_connection
1;
PK ! ٤ѯ- - autosplit.ixnu [ # Index created by AutoSplit for blib/lib/Net/SSLeay.pm
# (file acts as timestamp)
package Net::SSLeay;
sub want_nothing ;
sub want_read ;
sub want_write ;
sub want_X509_lookup ;
sub open_tcp_connection ;
sub open_proxy_tcp_connection ;
sub debug_read ;
sub ssl_read_all ;
sub tcp_read_all ;
sub ssl_write_all ;
sub tcp_write_all ;
sub ssl_read_until ($;$$);
sub tcp_read_until ;
sub ssl_read_CRLF ($;$);
sub tcp_read_CRLF ;
sub ssl_write_CRLF ($$);
sub tcp_write_CRLF ;
sub dump_peer_certificate ($);
sub randomize (;$$$);
sub new_x_ctx ;
sub initialize
;
sub sslcat ;
sub tcpcat ;
sub tcpxcat ;
sub https_cat ;
sub http_cat ;
sub httpx_cat ;
sub set_cert_and_key ($$$);
sub set_server_cert_and_key ($$$);
sub set_proxy ($$;**);
sub make_form ;
sub make_headers ;
sub do_httpx3 ;
sub do_https3 ;
sub do_httpx2 ;
sub do_https2 ;
sub do_httpx4 ;
sub do_https4 ;
sub get_https ;
sub post_https ;
sub put_https ;
sub head_https ;
sub get_https3 ;
sub post_https3 ;
sub put_https3 ;
sub head_https3 ;
sub get_https4 ;
sub post_https4 ;
sub put_https4 ;
sub head_https4 ;
sub get_http ;
sub post_http ;
sub put_http ;
sub head_http ;
sub get_http3 ;
sub post_http3 ;
sub put_http3 ;
sub head_http3 ;
sub get_http4 ;
sub post_http4 ;
sub put_http4 ;
sub head_http4 ;
sub get_httpx ;
sub post_httpx ;
sub put_httpx ;
sub head_httpx ;
sub get_httpx3 ;
sub post_httpx3 ;
sub put_httpx3 ;
sub head_httpx3 ;
sub get_httpx4 ;
sub post_httpx4 ;
sub put_httpx4 ;
sub head_httpx4 ;
sub do_https ;
1;
PK ! a-// /
initialize.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1032 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/initialize.al)"
###
### Standard initialisation. Initialise the ssl library in the usual way
### at most once. Override this if you need differnet initialisation
### SSLeay_add_ssl_algorithms is also protected against multiple runs in SSLeay.xs
### and is also mutex protected in threading perls
###
my $library_initialised;
sub initialize
{
if (!$library_initialised)
{
load_error_strings(); # Some bloat, but I'm after ease of use
SSLeay_add_ssl_algorithms(); # and debuggability.
randomize();
$library_initialised++;
}
}
# end of Net::SSLeay::initialize
1;
PK ! S do_httpx3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1361 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/do_httpx3.al)"
sub do_httpx3 {
my ($method, $usessl, $site, $port, $path, $headers,
$content, $mime_type, $crt_path, $key_path) = @_;
my ($response, $page, $h,$v);
my $len = blength($content);
if ($len) {
$mime_type = "application/x-www-form-urlencoded" unless $mime_type;
$content = "Content-Type: $mime_type$CRLF"
. "Content-Length: $len$CRLF$CRLF$content";
} else {
$content = "$CRLF$CRLF";
}
my $req = "$method $path HTTP/1.0$CRLF";
unless (defined $headers && $headers =~ /^Host:/m) {
$req .= "Host: $site";
unless (($port == 80 && !$usessl) || ($port == 443 && $usessl)) {
$req .= ":$port";
}
$req .= $CRLF;
}
$req .= (defined $headers ? $headers : '') . "Accept: */*$CRLF$content";
warn "do_httpx3($method,$usessl,$site:$port)" if $trace;
my ($http, $errs, $server_cert)
= httpx_cat($usessl, $site, $port, $req, $crt_path, $key_path);
return (undef, "HTTP/1.0 900 NET OR SSL ERROR$CRLF$CRLF$errs") if $errs;
$http = '' if !defined $http;
($headers, $page) = split /\s?\n\s?\n/, $http, 2;
warn "headers >$headers< page >>$page<< http >>>$http<<<" if $trace>1;
($response, $headers) = split /\s?\n/, $headers, 2;
return ($page, $response, $headers, $server_cert);
}
# end of Net::SSLeay::do_httpx3
1;
PK ! _B B
get_https3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1435 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/get_https3.al)"
sub get_https3 { do_httpx3(GET => 1, @_) }
# end of Net::SSLeay::get_https3
1;
PK ! ݊`|e e want_nothing.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 503 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/want_nothing.al)"
### Some methods that are macros in C
sub want_nothing { want(shift) == 1 }
# end of Net::SSLeay::want_nothing
1;
PK ! 3:> > post_http.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1448 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/post_http.al)"
sub post_http { do_httpx2(POST => 0, @_) }
# end of Net::SSLeay::post_http
1;
PK ! =UQ? ?
put_httpx3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1471 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/put_httpx3.al)"
sub put_httpx3 { do_httpx3(PUT => @_) }
# end of Net::SSLeay::put_httpx3
1;
PK ! d͝ set_server_cert_and_key.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1316 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/set_server_cert_and_key.al)"
### Old deprecated API
sub set_server_cert_and_key ($$$) { &set_cert_and_key }
### Set up to use web proxy
# end of Net::SSLeay::set_server_cert_and_key
1;
PK ! 8 https_cat.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1178 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/https_cat.al)"
###
### Basic request - response primitive, this is different from sslcat
### because this does not shutdown the connection.
###
sub https_cat { # address, port, message --> returns reply / (reply,errs,cert)
my ($dest_serv, $port, $out_message, $crt_path, $key_path) = @_;
my ($ctx, $ssl, $got, $errs, $written);
($got, $errs) = open_proxy_tcp_connection($dest_serv, $port);
return (wantarray ? (undef, $errs) : undef) unless $got;
### Do SSL negotiation stuff
warn "Creating SSL $ssl_version context...\n" if $trace>2;
initialize();
$ctx = new_x_ctx();
goto cleanup2 if $errs = print_errs('CTX_new') or !$ctx;
CTX_set_options($ctx, &OP_ALL);
goto cleanup2 if $errs = print_errs('CTX_set_options');
warn "Cert `$crt_path' given without key" if $crt_path && !$key_path;
set_cert_and_key($ctx, $crt_path, $key_path) if $crt_path;
warn "Creating SSL connection (context was '$ctx')...\n" if $trace>2;
$ssl = new($ctx);
goto cleanup if $errs = print_errs('SSL_new') or !$ssl;
warn "Setting fd (ctx $ctx, con $ssl)...\n" if $trace>2;
set_fd($ssl, fileno(SSLCAT_S));
goto cleanup if $errs = print_errs('set_fd');
warn "Entering SSL negotiation phase...\n" if $trace>2;
if ($trace>2) {
my $i = 0;
my $p = '';
my $cipher_list = 'Cipher list: ';
$p=Net::SSLeay::get_cipher_list($ssl,$i);
$cipher_list .= $p if $p;
do {
$i++;
$cipher_list .= ', ' . $p if $p;
$p=Net::SSLeay::get_cipher_list($ssl,$i);
} while $p;
$cipher_list .= '\n';
warn $cipher_list;
}
$got = Net::SSLeay::connect($ssl);
warn "SSLeay connect failed" if $trace>2 && $got==0;
goto cleanup if $errs = print_errs('SSL_connect');
my $server_cert = get_peer_certificate($ssl);
print_errs('get_peer_certificate');
if ($trace>1) {
warn "Cipher `" . get_cipher($ssl) . "'\n";
print_errs('get_ciper');
warn dump_peer_certificate($ssl);
}
### Connected. Exchange some data (doing repeated tries if necessary).
warn "https_cat $$: sending " . blength($out_message) . " bytes...\n"
if $trace==3;
warn "https_cat $$: sending `$out_message' (" . blength($out_message)
. " bytes)...\n" if $trace>3;
($written, $errs) = ssl_write_all($ssl, $out_message);
goto cleanup unless $written;
warn "waiting for reply...\n" if $trace>2;
($got, $errs) = ssl_read_all($ssl);
warn "Got " . blength($got) . " bytes.\n" if $trace==3;
warn "Got `$got' (" . blength($got) . " bytes)\n" if $trace>3;
cleanup:
free ($ssl);
$errs .= print_errs('SSL_free');
cleanup2:
CTX_free ($ctx);
$errs .= print_errs('CTX_free');
close SSLCAT_S;
return wantarray ? ($got, $errs, $server_cert) : $got;
}
# end of Net::SSLeay::https_cat
1;
PK ! i0ғ5 5 sslcat.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1051 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/sslcat.al)"
###
### Basic request - response primitive (don't use for https)
###
sub sslcat { # address, port, message, $crt, $key --> reply / (reply,errs,cert)
my ($dest_serv, $port, $out_message, $crt_path, $key_path) = @_;
my ($ctx, $ssl, $got, $errs, $written);
($got, $errs) = open_proxy_tcp_connection($dest_serv, $port);
return (wantarray ? (undef, $errs) : undef) unless $got;
### Do SSL negotiation stuff
warn "Creating SSL $ssl_version context...\n" if $trace>2;
initialize(); # Will init at most once
$ctx = new_x_ctx();
goto cleanup2 if $errs = print_errs('CTX_new') or !$ctx;
CTX_set_options($ctx, &OP_ALL);
goto cleanup2 if $errs = print_errs('CTX_set_options');
warn "Cert `$crt_path' given without key" if $crt_path && !$key_path;
set_cert_and_key($ctx, $crt_path, $key_path) if $crt_path;
warn "Creating SSL connection (context was '$ctx')...\n" if $trace>2;
$ssl = new($ctx);
goto cleanup if $errs = print_errs('SSL_new') or !$ssl;
warn "Setting fd (ctx $ctx, con $ssl)...\n" if $trace>2;
set_fd($ssl, fileno(SSLCAT_S));
goto cleanup if $errs = print_errs('set_fd');
warn "Entering SSL negotiation phase...\n" if $trace>2;
if ($trace>2) {
my $i = 0;
my $p = '';
my $cipher_list = 'Cipher list: ';
$p=Net::SSLeay::get_cipher_list($ssl,$i);
$cipher_list .= $p if $p;
do {
$i++;
$cipher_list .= ', ' . $p if $p;
$p=Net::SSLeay::get_cipher_list($ssl,$i);
} while $p;
$cipher_list .= '\n';
warn $cipher_list;
}
$got = Net::SSLeay::connect($ssl);
warn "SSLeay connect returned $got\n" if $trace>2;
goto cleanup if $errs = print_errs('SSL_connect');
my $server_cert = get_peer_certificate($ssl);
print_errs('get_peer_certificate');
if ($trace>1) {
warn "Cipher `" . get_cipher($ssl) . "'\n";
print_errs('get_ciper');
warn dump_peer_certificate($ssl);
}
### Connected. Exchange some data (doing repeated tries if necessary).
warn "sslcat $$: sending " . blength($out_message) . " bytes...\n"
if $trace==3;
warn "sslcat $$: sending `$out_message' (" . blength($out_message)
. " bytes)...\n" if $trace>3;
($written, $errs) = ssl_write_all($ssl, $out_message);
goto cleanup unless $written;
sleep $slowly if $slowly; # Closing too soon can abort broken servers
CORE::shutdown SSLCAT_S, 1; # Half close --> No more output, send EOF to server
warn "waiting for reply...\n" if $trace>2;
($got, $errs) = ssl_read_all($ssl);
warn "Got " . blength($got) . " bytes.\n" if $trace==3;
warn "Got `$got' (" . blength($got) . " bytes)\n" if $trace>3;
cleanup:
free ($ssl);
$errs .= print_errs('SSL_free');
cleanup2:
CTX_free ($ctx);
$errs .= print_errs('CTX_free');
close SSLCAT_S;
return wantarray ? ($got, $errs, $server_cert) : $got;
}
# end of Net::SSLeay::sslcat
1;
PK ! g? ? head_http.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1450 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/head_http.al)"
sub head_http { do_httpx2(HEAD => 0, @_) }
# end of Net::SSLeay::head_http
1;
PK ! }i ssl_read_CRLF.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 910 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/ssl_read_CRLF.al)"
# ssl_read_CRLF($ssl [, $max_length])
sub ssl_read_CRLF ($;$) { ssl_read_until($_[0], $CRLF, $_[1]) }
# end of Net::SSLeay::ssl_read_CRLF
1;
PK ! `}RB B
head_http3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1455 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/head_http3.al)"
sub head_http3 { do_httpx3(HEAD => 0, @_) }
# end of Net::SSLeay::head_http3
1;
PK ! ԯ? ? put_http4.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1459 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/put_http4.al)"
sub put_http4 { do_httpx4(PUT => 0, @_) }
# end of Net::SSLeay::put_http4
1;
PK ! a do_https3.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1396 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/do_https3.al)"
sub do_https3 { splice(@_,1,0) = 1; do_httpx3; } # Legacy undocumented
### do_https2() is a legacy version in the sense that it is unable
### to return all instances of duplicate headers.
# end of Net::SSLeay::do_https3
1;
PK ! B!5 5 want_read.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 506 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/want_read.al)"
sub want_read { want(shift) == 2 }
# end of Net::SSLeay::want_read
1;
PK ! )H< < put_httpx.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1466 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/put_httpx.al)"
sub put_httpx { do_httpx2(PUT => @_) }
# end of Net::SSLeay::put_httpx
1;
PK ! 1 tcp_read_CRLF.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 912 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcp_read_CRLF.al)"
sub tcp_read_CRLF { tcp_read_until($CRLF, $_[0]) }
# ssl_write_CRLF($ssl, $message) writes $message and appends CRLF
# end of Net::SSLeay::tcp_read_CRLF
1;
PK ! [~ randomize.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 966 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/randomize.al)"
### Arrange some randomness for eay PRNG
sub randomize (;$$$) {
my ($rn_seed_file, $seed, $egd_path) = @_;
my $rnsf = defined($rn_seed_file) && -r $rn_seed_file;
$egd_path = '';
$egd_path = $ENV{'EGD_PATH'} if $ENV{'EGD_PATH'};
RAND_seed(rand() + $$); # Stir it with time and pid
unless ($rnsf || -r $Net::SSLeay::random_device || $seed || -S $egd_path) {
my $poll_retval = Net::SSLeay::RAND_poll();
warn "Random number generator not seeded!!!" if $trace && !$poll_retval;
}
RAND_load_file($rn_seed_file, -s _) if $rnsf;
RAND_seed($seed) if $seed;
RAND_seed($ENV{RND_SEED}) if $ENV{RND_SEED};
RAND_load_file($Net::SSLeay::random_device, $Net::SSLeay::how_random/8)
if -r $Net::SSLeay::random_device;
}
# end of Net::SSLeay::randomize
1;
PK ! tcp_read_all.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 612 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcp_read_all.al)"
sub tcp_read_all {
my ($how_much) = @_;
$how_much = 2000000000 unless $how_much;
my ($n, $got, $errs);
my $reply = '';
my $bsize = 0x10000;
while ($how_much > 0) {
$n = sysread(SSLCAT_S,$got, (($bsize < $how_much) ? $bsize : $how_much));
warn "Read error: $! ($n,$how_much)" unless defined $n;
last if !$n; # EOF
$how_much -= $n;
debug_read(\$reply, \$got) if $trace>1;
$reply .= $got;
}
return wantarray ? ($reply, $errs) : $reply;
}
# end of Net::SSLeay::tcp_read_all
1;
PK ! 4B B
head_https.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1433 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/head_https.al)"
sub head_https { do_httpx2(HEAD => 1, @_) }
# end of Net::SSLeay::head_https
1;
PK ! 4$ do_https2.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1411 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/do_https2.al)"
sub do_https2 { splice(@_,1,0) = 1; do_httpx2; } # Legacy undocumented
### Returns headers as a hash where multiple instances of same header
### are handled correctly.
# end of Net::SSLeay::do_https2
1;
PK ! 1Rk tcp_write_CRLF.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 930 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcp_write_CRLF.al)"
sub tcp_write_CRLF {
# the next line uses less memory but might use more network packets
return tcp_write_all($_[0]) + tcp_write_all($CRLF);
# the next few lines do the same thing at the expense of memory, with
# the chance that it will use less packets, since CRLF is in the original
# message and won't be sent separately.
#my $data_ref;
#if (ref $_[1]) { $data_ref = $_[1] }
# else { $data_ref = \$_[1] }
#my $message = $$data_ref . $CRLF;
#return tcp_write_all($_[0], \$message);
}
# end of Net::SSLeay::tcp_write_CRLF
1;
PK ! +h ssl_read_all.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 584 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/ssl_read_all.al)"
sub ssl_read_all {
my ($ssl,$how_much) = @_;
$how_much = 2000000000 unless $how_much;
my ($got, $rv, $errs);
my $reply = '';
while ($how_much > 0) {
($got, $rv) = Net::SSLeay::read($ssl,
($how_much > 32768) ? 32768 : $how_much
);
if (! defined $got) {
my $err = Net::SSLeay::get_error($ssl, $rv);
if ($err != Net::SSLeay::ERROR_WANT_READ() and
$err != Net::SSLeay::ERROR_WANT_WRITE()) {
$errs = print_errs('SSL_read');
last;
}
next;
}
$how_much -= blength($got);
debug_read(\$reply, \$got) if $trace>1;
last if $got eq ''; # EOF
$reply .= $got;
}
return wantarray ? ($reply, $errs) : $reply;
}
# end of Net::SSLeay::ssl_read_all
1;
PK ! o<.B B
get_https4.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1440 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/get_https4.al)"
sub get_https4 { do_httpx4(GET => 1, @_) }
# end of Net::SSLeay::get_https4
1;
PK ! 0 do_httpx4.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1416 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/do_httpx4.al)"
sub do_httpx4 {
my ($page, $response, $headers, $server_cert) = &do_httpx3;
my %hr = ();
for my $hh (split /\s?\n/, $headers) {
my ($h,$v) = ($hh =~ /^(\S+)\:\s*(.*)$/);
push @{$hr{uc($h)}}, $v;
}
return ($page, $response, \%hr, $server_cert);
}
# end of Net::SSLeay::do_httpx4
1;
PK ! CA
tcpxcat.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1169 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcpxcat.al)"
sub tcpxcat {
my ($usessl, $site, $port, $req, $crt_path, $key_path) = @_;
if ($usessl) {
return sslcat($site, $port, $req, $crt_path, $key_path);
} else {
return tcpcat($site, $port, $req);
}
}
# end of Net::SSLeay::tcpxcat
1;
PK ! zK set_proxy.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 1322 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/set_proxy.al)"
sub set_proxy ($$;**) {
($proxyhost, $proxyport, $proxyuser, $proxypass) = @_;
require MIME::Base64 if $proxyuser;
$proxyauth = $proxyuser
? $CRLF . 'Proxy-authorization: Basic '
. MIME::Base64::encode("$proxyuser:$proxypass", '')
: '';
}
# end of Net::SSLeay::set_proxy
1;
PK ! 7 tcp_read_until.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 885 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/tcp_read_until.al)"
sub tcp_read_until {
my ($delim, $max_length) = @_;
# guess the delim string if missing
if ( ! defined $delim ) {
if ( defined $/ && length $/ ) { $delim = $/ }
else { $delim = "\n" } # Note: \n,$/ value depends on the platform
}
my $len_delim = length $delim;
my ($n,$got);
my $reply = '';
while (!defined $max_length || length $reply < $max_length) {
$n = sysread(SSLCAT_S, $got, 1); # one by one
warn "tcp_read_until: $!" if !defined $n;
debug_read(\$reply, \$got) if $trace>1;
last if !$n; # EOF
$reply .= $got;
last if $len_delim
&& substr($reply, blength($reply)-$len_delim) eq $delim;
}
return $reply;
}
# end of Net::SSLeay::tcp_read_until
1;
PK ! A, , ssl_write_CRLF.alnu [ # NOTE: Derived from blib/lib/Net/SSLeay.pm.
# Changes made here will be lost when autosplit is run again.
# See AutoSplit.pm.
package Net::SSLeay;
#line 915 "blib/lib/Net/SSLeay.pm (autosplit into blib/lib/auto/Net/SSLeay/ssl_write_CRLF.al)"
sub ssl_write_CRLF ($$) {
# the next line uses less memory but might use more network packets
return ssl_write_all($_[0], $_[1]) + ssl_write_all($_[0], $CRLF);
# the next few lines do the same thing at the expense of memory, with
# the chance that it will use less packets, since CRLF is in the original
# message and won't be sent separately.
#my $data_ref;
#if (ref $_[1]) { $data_ref = $_[1] }
# else { $data_ref = \$_[1] }
#my $message = $$data_ref . $CRLF;
#return ssl_write_all($_[0], \$message);
}
# end of Net::SSLeay::ssl_write_CRLF
1;
PK ! z{p p SSLeay.sonu 7m ELF > 0&