Closed frett closed 11 years ago
Merged and uploaded to CPAN in 1.0.7. Thanks for your contribution.
I found a case where it's not working correctly. The following script works fine, where $rpc is a subclass of LWP::UserAgent:
#!/usr/bin/env perl
use strict;
use warnings;
use Finance::Bitcoin::API;
my $rpc = Finance::Bitcoin::API->new(
endpoint => "https://rpc.blockchain.info/"
);
my $ua = $rpc->jsonrpc->ua;
$ua->set_my_handler(
response_done => sub { $_[0]->dump(maxlength => 0); return }
);
my $res = $rpc->call(getinfo => ());
It successfully handles the SSL handshake, though it does produce a higher-level error because the user credentials are missing.
But Using LWP::Protocol::AnyEvent::http results in an SSL handshake error:
#!/usr/bin/env perl
use strict;
use warnings;
use Finance::Bitcoin::API;
use Coro qw(async);
use LWP::Protocol::AnyEvent::http;
my $rpc = Finance::Bitcoin::API->new(
endpoint => "https://rpc.blockchain.info/"
);
my $ua = $rpc->jsonrpc->ua;
$ua->set_my_handler(
response_done => sub { $_[0]->dump(maxlength => 0); return }
);
async {
my $res = $rpc->call(getinfo => ());
}->join;
Hello,
The license I use is less restrictive than LWP-Protocol-https's so I can't just take code from it. Most of the code you posted is yours or required to use the relevant APIs, but I'll have to ask before I can copy that error message.