OSStatus error -9806

1,736 views
Skip to first unread message

arb

unread,
Nov 20, 2011, 9:56:14 PM11/20/11
to ASIHTTPRequest
I am using ASIHTTPRequest in an iPhone app to log into a website and
scrape some details. The login uses https to POST username/password to
the server. and that works fine. I then retrieve the URL of my target
page (which is in an iframe) from the HTML returned but when I attempt
to fetch that page I get an error: OSStatus error -9806.

The page I am trying to fetch is on a different subdomain. Everything
works fine when I access the pages in a browser on my Mac - Safari,
Firefox and Chrome all work fine, with no errors or warnings. When I
try to load the pages in Safari on my iPhone, the login works fine,
but the target page does not load and there is no error.


I am using ASIHTTPRequest in an iPhone project to log into a website
and scrape some details and have encountered an error I can't quite
figure out. I am using https to post username/password to the server.
The login works fine, but when I try to fetch one of the pages which
is one a different subdomain, I get an error: OSStatus error -9806.

The page I am trying to fetch resides in an iframe on the main page,
but has a different subdomain. The page and frame load fine in a
browser on my Mac with no errors or warnings (I have tried Safari,
Firefox and Chrome - all okay) but when I try to load the page in
Safari on the iPhone the login works fine, but the iframe doesn't
load, and I get no errors. I wrote a short test app using a UIWebView
so I could try to trap any errors Safari was raising, and when I try
to load the iframe page, I get an error: "An SSL error has occurred
and a secure connection to the server cannot be made."

I have tried [request setValidatesSecureCertificate:NO] but I am
getting the same error. Any ideas?

(FWIW the guys working on the Android version of this app have had no
problems with this particular site - everything works peachy from
java, so we are at a loss here.)

arb

unread,
Nov 24, 2011, 7:52:06 PM11/24/11
to ASIHTTPRequest
On Nov 21, 1:56 pm, arb <amo...@gmail.com> wrote:
> I am using ASIHTTPRequest in an iPhone app to log into a website and
> scrape some details. The login uses https to POST username/password to
> the server. and that works fine. I then retrieve the URL of my target
> page (which is in an iframe) from the HTML returned but when I attempt
> to fetch that page I get an error: OSStatus error -9806.
> [...]

I found a Technical Note that may shed some light on this error, but I
am not sure where this workaround would fit into ASIHTTPRequest:
http://developer.apple.com/library/ios/#technotes/tn2287/_index.html#//apple_ref/doc/uid/DTS40011309

Reply all
Reply to author
Forward
0 new messages