Solved

cURL always return "401 Unauthorized"

Posted on 2008-06-24
2
1,517 Views
Last Modified: 2010-04-21
Hi,

I'm trying to automatically download log files from our video conference servers. When I try this with a browser is works (authentication -> save file as).

Now I want to use the cURL command in a script to get the files but it wont work. Here the command I use:

curl --anyauth --insecure --proxy-user 'xxx:yyy' --proxy-ntlm --proxy 'http://x.x.x.x:8080/' --connect-timeout '10' --user 'authname:authpw' --output 'output.txt' https://x.x.x.x/localcdr.csv

The result in the output.txt file = 401 Unauthorized - User authentication is required.

Now the tricky part: 1 of the 7 servers is returning the file with the above command, the other 6 wont :(
With a browser => they work.

Who can help me or has some tips?

Thanks in advance
Filips
0
Comment
Question by:Filips
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 4

Accepted Solution

by:
snrudda earned 250 total points
ID: 21854998
May find a way out of this fuzz by using sniffer like Wireshark (http://www.wireshark.org/) to see what's the difference between 1 and 6 servers.

I'd rather said servers check some secondary attributes like User-agent or Cookies, you may never guess that without sniffer :)
0
 
LVL 6

Author Closing Comment

by:Filips
ID: 31470103
This was a good hint. I didn't do a sniff but checked the headers with another tool. Result: our network guys made an error in the authentication module.

Thanks snrudda
0

Featured Post

WordPress Tutorial 4: Recommended Plugins

Now that you have WordPress installed, understand the interface, and know how to install new parts, let’s take a look at our recommended plugins.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question