bigup401 has asked for the wisdom of the Perl Monks concerning the following question:

Error: No backend configured for scheme https

my $http = HTTP::Tinyish->new(); my $res = $http->post("https://api.sandbox.paypal.com/v1/oauth2/token +/", { headers => { 'username' => 'client_id', 'password' => 'screte', 'grant_type' => 'client_credentials'} }); $http->get("https://api.paypal.com/v1/payments/payment/PAY-5YK922393 +D847794YKER7MUI", { headers => { 'Content-Type' => 'application/json' }, }); if ( $res->{'is_success'} ) { print Dumper( decode_json $res->{'content'} ); } else { print "$res->{'status'} $res->{'reason'}\n"; }

Replies are listed 'Best First'.
Re: https error
by dorko (Prior) on Nov 01, 2018 at 01:36 UTC
    Hmm... That's not much to work with, but I'll take a stab at it. The docs for HTTP::Tinyish say:

    HTTP::Tinyish is a wrapper module for HTTP client modules LWP, HTTP::Tiny and HTTP client software curl and wget.

    Backends are searched in the order of: LWP, HTTP::Tiny, Curl and Wget. HTTP::Tinyish will auto-detect if the backend also supports HTTPS, and use the appropriate backend based on the given URL to the request methods.

    It sounds like that module tries pretty hard to find a way to load SSL URLs. If you're getting a "no backend configured for scheme https" error, my first question would be do you have OpenSSL installed? My next question would be can you access any HTTPS URL with LWP, HTTP::Tiny, curl or wget?

    Cheers,

    Brent

    -- Yeah, I'm a Delt.

    UPDATE: It's a slow night, so I had the time to read the source and the tests for HTTP::Tinyish look like they'll autodetect if SSL support is available on the four supported HTTP backends - LWP, HTTP::Tiny, curl, and wget - and run two SSL tests (per backend) if possible. What happens when you run the tests? - presumably you ran them when you installed the module?

      yes i have openssl installed on my producation server

        Hi bigup401,

        Have you tried curl or wget on an HTTPS URL from the command line?

        Do you have Net::SSLeay installed?

        Cheers,

        Brent

        -- Yeah, I'm a Delt.

        As dorko mentions you can check if Net::SSLeay is installed. However to enable HTTPS support for LWP this is only a part of what is needed. HTTPS support for LWP depends on LWP::Protocol::https which on its turn depends on IO::Socket::SSL, and that depends on Net::SSLeay.

        So the correct way to enable HTTPS support for LWP is:

        cpan install LWP::Protocol::https   # or equivalent

        I do not know about the other backends.

Re: https error
by Corion (Patriarch) on Nov 01, 2018 at 14:59 UTC

    Crossposted on Stackoverflow.

    While crossposting is acceptable, it is considered polite to inform about it so that efforts are not duplicated.

      tho am just thinking up. it may be hard error to fix lol. coz all the modules are installed. and everyone seems to be not aware of this such error before