pjf / WebService-HabitRPG

Access the HabitRPG API from Perl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SSL Failure

toddgrotenhuis opened this issue · comments

When trying to execute tasks:

"Error GETing https://habitrpg.com/api/v1/user/tasks?type=todo: Can't verify SSL peers without knowning which Certificate Authorities to trust at /Library/Perl/5.12/WebService/HabitRPG.pm line 177"

which is this section:

Internal use only code beyond this point

method _get_tasks($url) {
my $results = $self->_get_request($url);

my @tasks;

# Somehow we can get back completely undefined results,
# hence the grep to only look at defined ones.

foreach my $raw (grep { defined } @$results) {
    push @tasks, WebService::HabitRPG::Task->new(
        $raw,
    );
}

return \@tasks;

}

Wow! That's a new one! Try:

cpanm Mozilla::CA

to install the certificates? I have no idea why my machine doesn't need this (maybe it's able to find system certs?)

Success!

Thank you so much for reporting this! The next release will make sure it includes the CA Certs as part of the dependency chain!

Looks like ti may be system-specific. I've installed three places, now, and only the OSX install had this issue (other two locations were an ubuntu desktop and an ubuntu server VPS).

I've had one OSX user say things are painfully slow with the default configuration. If that happens for you, please let me know (as it means it can be reproduced across machines), but rejoice that there's a workaround by disabling keep-alive connections (GH #25).

A Mozilla::CA bundled with the OS would be obsolete anyway, so you should install the latest one.

But even that will not make you safer as even the latest CPAN release of Mozilla::CA is obsolete. See RT#97559.