libwww-perl / HTTP-Message

The HTTP-Message distribution contains classes useful for representing the messages passed in HTTP style communication.

Home Page:https://metacpan.org/pod/HTTP::Message

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bio::DB::Taxonomy won't connect to NCBI

kastevens opened this issue · comments

When I use Bio:DB:Taxonomy I get the following error:

MSG: Can't query website: 500 Can't connect to eutils.ncbi.nlm.nih.gov:443
STACK: Error::throw
STACK: Bio::Root::Root::throw /usr/share/perl5/Bio/Root/Root.pm:449
STACK: Bio::DB::Taxonomy::entrez::_run_query /usr/share/perl5/Bio/DB/Taxonomy/entrez.pm:658
STACK: Bio::DB::Taxonomy::entrez::get_taxon /usr/share/perl5/Bio/DB/Taxonomy/entrez.pm:267

NCBIs response:

have upgraded our web front ends to comply with current security protocols. Fundamentally, all software must be using TLS v1.2 to gain access. According to this thread, https://stackoverflow.com/questions/51110181/perl-lwp-why-does-iosocketssl-use-tls-1-0-while-netssl-uses-tls-1-2, changing the following in your Perl code should work:

replace "use IO::Socket::SSL;" with "use Net::SSL;"

Do you have a snippet of code to demonstrate the problem?

That stack overflow thread does not recommend switching IO::Socket::SSL to Net::SSL.

I'm going to go ahead and close this out as it's not a problem of the HTTP::Message module. You probably just need to update your IO::Socket::SSL module.

sudo apt install libdb-dev
cpanm -L local Bio::DB::Taxonomy IO::Socket::SSL LWP::Protocol::https Bio::DB::Taxonomy::entrez
#!/usr/bin/env perl

use strict;
use warnings;
use v5.32;
use local::lib 'local';
use Bio::DB::Taxonomy;

my $db = Bio::DB::Taxonomy->new(-source => 'entrez');
my $id = $db->get_taxonid('homo sapiens');
say $id;
$ perl test.pl 
9606