Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

How can I connect to an HTTPS server using the Perl JIRA::Client::Automated module through Proxy?

by hanish_cbit (Initiate)
on Jan 25, 2015 at 19:23 UTC ( [id://1114456]=perlquestion: print w/replies, xml ) Need Help??

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

I am new to use JIRA and REST API.Please tell me how to connect to HTTPS jira server using JIRA::Client::Automated module. I am trying to connect to jira server using below code.

use strict; use warnings use JIRA::Client::Automated; my $user = 'foo'; my $pass = 'bar'; my $url = 'https://xxx.yyy.com/jira-stage/'; my $jira = JIRA::Client::Automated->new($url, $user, $pass); my $ua = $jira->ua(); $ua->proxy('http', 'http://proxy.com:8000'); $search_results = $jira->search_issues(project in (sample), 0, 1000); my $count = $search_results->{'total'}; print "$count";

But using the above code always gives me an 500 error saying Unable to connect. Since I am trying to connect from my Local Machine, the request is not going through Local system proxy. Please let me know how to connect through Proxy

I am able to access the same rest url using the webbrowser of my local machine. Please suggest if I am doing anything wrong.

  • Comment on How can I connect to an HTTPS server using the Perl JIRA::Client::Automated module through Proxy?
  • Download Code

Replies are listed 'Best First'.
Re: How can I connect to an HTTPS server using the Perl JIRA::Client::Automated module through Proxy?
by reinaldo.gomes (Beadle) on Apr 15, 2019 at 21:45 UTC

    Just change the following line

    $ua->proxy('http', 'http://proxy.com:8000');

    for this one

    $ua->env_proxy('http_proxy');

    Be aware that you might have to replace 'http_proxy' for whatever name you gave to it in you /etc/environment file.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1114456]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-18 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found