Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Authentication problem using curl from command line

Bernd Pichlbauer August 23, 2014

Dear all,

I am trying to write a JIRA plugin using PHP and the JIRA Rest API.

The problem is I cannot connect to JIRA using curl.

Even when I try from command line:

root@mydevel:~# curl -u admin:admin http://localhost:2990/jira/rest/api/2/user/search/?username=admin

curl: (7) couldn't connect to host

I get this "could not connect to host" error.

I can fetch other site like "http://www.google.com" though.

However when try the RESP call in the browser I get the correct response.

Does anybody know, what the problem could be?

Thanks a lot,

Bernd

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Benito Picarelli
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 24, 2014

Hi Bernd,

What version of JIRA are you running?

Also, this could be caused by some firewall blocking the port. I'm assuming that if you make the request to that URL in the browser it works?

Best regards

0 votes
Bernd Pichlbauer August 25, 2014

Hi Benito,

Thanks for you input - obviously that was the problem.

Jira is running on my macbook, however my helloworld.php script is running on my webserver which is a virtual machine. Hence, the virtual machine cannot access jira via localhost:2990.

When I access jira via http://bernds-macbook-pro.local:2990/jirafrom within the VM it is working.

Best regards,

Bernd

TAGS
AUG Leaders

Atlassian Community Events