Just a little update,
-1012 is NSURLErrorUserCancelledAuthentication, and that caught my
suspicioun that perhaps data got sent anyway. So fire up Wireshark,
and sure enough, my request is sent:
And a 401 is passed back, with NTLM authentication, not Basic. Sorry
about that, but it doesn't really change anything with my problem as
far as I know:
And then of course it fails again, and the -1012 is returned saying
the user cancled while in fact, no authentication info was sent. So my
question is: how can I make a correct NTLM authentication via HTTP,
because what I'm doing right now seems to be incorrect
Cheers
Nik
On Jun 30, 2008, at 11:54 AM, Niklas Saers wrote:
Hi,
I'm trying to connect to a server that requires HTTP authentication
and that lives on a non-standard port. I've written a little bit of
code that works great when it tries to connect to a server on port
80, but I get an error when connecting to the non-standard port, and
I get it without it trying to connect at all:
{
NSErrorFailingURLKey = http://192.168.0.5:42334/;
NSErrorFailingURLStringKey = "http://192.168.0.5:42334/";
NSUnderlyingError = Error Domain=kCFErrorDomainCFNetwork
Code=-1012 UserInfo=0x1f0b40 "Operation could not be completed.
(kCFErrorDomainCFNetwork error -1012.)";
}
Here is my code:
+ (void) test {
NSString *host = @"http://192.168.0.5:42334/";
NSString *username = @"someuser";
NSString *password = @"somepass";
int port = 42334;
What am I doing wrong? How should I modify the code to connect
correctly? Also, do I need to do anything specific if I want to
support servers that require NTLM or Digest authentication rather
than Basic? Where can I look up errorcode -1012?
Cheers
Nik
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com