Error in WebRequest - windows-phone-7

I'm working with WebClient for some time now. (using the Mango SDK)
Each time I have an error, the error message is always "Not Found". Either the error is due to login problem, server or page not found. Any error code >= 400 cause the same Exception with the same message and no data.
I tried to use the WebRequest/WebResponse but it seems the problem is always the same.
I mean, I know how to write it correctly in C# (for desktop), but on windows phone, I have no way to access the error code nor the response body.
I found many posts talking about the problem, but no solutions are pointed.
Does anyone have a solution or a workaround (even a dirty one...) I'm open to any suggestion.

That (very misleading) error is often caused by an underlying HTTP error.
If you are using HTTPS, it could be because it's a self-signed (or otherwise unsupported) certificate. You can temporarily get around this by emailing the certificate to an account on the phone, but this won't fly in the marketplace.
If the requests aren't HTTPS, you can run Fiddler to find out what the underlying error is. (Pro tip: The WP emulator will only the use Fiddler if Fiddler was running when it started up so you may have to close it down).
To access the data, you need to get the WebException (it may be the InnerException of what is being thrown) and then you can access the Response

Related

My site is throwing "connection insecure" in firefox

I've heard from someone that my site throws "connection is not secure" error in Mozilla Firefox. I checked it at my computer in firefox and it's working fully fine, so is it users problem that this error is thrown or can I do something about it on my site?
The problem is with the users firewall, or your website, it could be that the encryption is not strong enough or you can only recieve a valid certificate on your home wifi due to an error in the website, it could also be due to an outdated TLS mechanism.

NSURLConnectionLoader exception on first HTTPS request

I have an IOS App that sends HTTPS request to a server, using NSURLConnection, it works without any issue.
Now, I'm trying to put this App on OSX and to reuse code from the IOS App. It's the first time I'm developing on OSX, so I'm a beginner ;-)
My OSX get an exception when I'm sending my first HTTPS requests (using Post), the exception is about NSURLConnectionLoader (it ends at libc++abi.dylib __cxa throw and it seems it has been raised due to security issue Security::KeyChainCore...).
Next, on the debugger, if I click many times on continue, the request is successfully sent and I'm get the correct answer from the server.
The following requests that are sent are working fine (no exceptions), only the first one has issues.
Any idea? Any differences between OSX and IOS for NSURLConnection?
Thanks for the help,
Sebastien.

Google checkout callback can't seem to reach https server

I am trying to implement Google Check out (GCO) on a new server, the process seemed to work fine on the old server.
The error from GCO integration console is the timeout error you might expect if there is load on the server and/or the response takes longer than 3 seconds to respond.
To perform a test (not integrating with my database), I have set some code to send an email to me instead. If I hit the https url manually, I get the email and I can see an output to the screen. If I then leave it as that, Google still returns the Timeout error and I don't get an email. So I have doubts as to whether google is even able to hit the https url.
I did temporarily attempt to use the unsecure url for testing and indeed I received the email, however this solution isn't the route we've developed for, so the problem is something to do with the secure url specifically.
I have looked into the certificate which is a UTN-USERFirst-Hardware which is listed as accepted on http://checkout.google.com/support/sell/bin/answer.py?answer=57856 . I have also tried to temporarily disable the firewall with no joy. Does anyone have any sugestions?
Good to hear you figured out the problem.
I'm adding the links below to add a litle more context for future readers about how Google Checkout uses HTTP Basic Authentication:
http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API.html#urls_for_posting
http://code.google.com/apis/checkout/developer/Google_Checkout_XML_API.html#https_auth_scheme
http://code.google.com/apis/checkout/developer/Google_Checkout_HTML_API_Notification_API.html#Receiving_and_Processing_Notifications

"The remote server returned an error: (401) Unauthorized." When trying to access Exchange via Webdav

I asked another question earlier about a 400 error. (http://stackoverflow.com/questions/6099557/the-remote-server-returned-an-error-400-bad-request-when-trying-to-access-e)
While waiting for responses, I tried a few other things and have now come across another unhelpful error. ("The remote server returned an error: (401) Unauthorized.").
I am trying to connect to http://mailserver/owa/. When I paste this URL into my browser, and type my credentials, I can get logged in just fine. When I try to connect with the same credentials through WebDav, I get the 401 error. How do the same credentials work one way, but not another way?
I tried using the authenticate method found here: http://blog.mbcharbonneau.com/2006/10/26/using-net-and-webdav-to-access-an-exchange-server/
I still get the same 401.
This seems like it should be so straightforward, yet all I can find out there are forums of people with the same problem. Nobody can provide and answer or working example. Has anyone actually ever been able to do this successfully before!?

Self-Signed SSL Link not working

I have an embedded web server with a self-signed SSL certificate. After I get past the Web Browser's warning about the SSL Certificate being self signed, I am seeing a difference between IE8 and Firefox 3.5.5.
In IE8, if I try to download a PNG file, it will download every time.
In FireFox, it will give me an error every other time.
The error message is this:
Secure Connection Failed
An error occurred during a connection to 192.168.1.100.
SSL peer was unable to negotiate an acceptable set of security parameters.
(Error code: ssl_error_handshake_failure_alert)
*The page you are trying to view can not be shown because the authenticity of the received data could not be verified.
*Please contact the web site owners to inform them of this problem. Alternatively, use the command found in the help menu to report this broken site.
What is causing this? Why does one browser work all the time and the other only works every other time?
It's hard to say without looking at the packets. If I had to hazard a guess, it would be that on the second request, Firefox is trying to resume the SSL session, and for some reason, the server doesn't like that. On the next request, Firefox doesn't try to resume, and it succeeds again. Maybe?

Resources