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?