Bug 7485 - getResponse throwing error, earlier version worked
Summary: getResponse throwing error, earlier version worked
Alias: None
Product: Android
Classification: Xamarin
Component: BCL Class Libraries ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
Depends on:
Reported: 2012-09-26 16:21 UTC by sujit
Modified: 2013-12-05 18:34 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description sujit 2012-09-26 16:21:05 UTC
I am using Monoddevelop and a code which was working isn't working now.
Mono for Android version : 4.2.6

string signInUrl = "https://www.googleapis.com/oauth2/v1/userinfo?alt=json&oauth_consumer_key=XXXXXX&oauth_nonce=1795826&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1348677991&oauth_token=XXXXX&oauth_version=1.0&oauth_signature=XXXXX";

HttpWebRequest request = (HttpWebRequest)WebRequest.Create (signInUrl);
HttpWebResponse response = (HttpWebResponse)request.GetResponse ();

Above line is thrrowing ERROR...

it was working before, why not now? I find monodroid frustrating when HTTP or HTTPS is involved.

Error is

    System.Net.WebException: Error getting response stream (Write: EndWrite failure): SendFailure ---> System.IO.IOException: EndWrite failure ---> System.Net.Sockets.SocketException: The socket has been shut down at System.Net.Sockets.Socket.EndSend (IAsyncResult result) [0x00000] in :0 at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in :0 --- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.EndWrite (IAsyncResult ar) [0x00000] in :0 at Mono.Security.Protocol.Tls.RecordProtocol.EndSendRecord (IAsyncResult asyncResult) [0x00000] in :0 at Mono.Security.Protocol.Tls.RecordProtocol.SendRecord

What should I do?
Comment 1 Jonathan Pryor 2012-11-27 17:11:02 UTC
When I try to access `signInUrl`, it fails with:

> UNHANDLED EXCEPTION: System.Net.WebException: The remote server returned an error: (401) Unauthorized.
>   at System.Net.HttpWebRequest.CheckFinalStatus (System.Net.WebAsyncResult result)
>   at System.Net.HttpWebRequest.SetResponseData (System.Net.WebConnectionData data)

Given that this is an OAuth login, that doesn't seem to unreasonable.

Meanwhile, if I use a HTTPS url that doesn't require authentication, it works, e.g. https://www.google.com/.

I'm testing with 4.4.0, though the relevant SSL fixes _should_ have been in 4.2.6 or 4.2.7.
Comment 2 PJ 2013-11-19 17:04:17 UTC
This bug has been in the NEEDINFO state with no changes for the last 90 days. Can we put this back into the NEW or CONFIRMED state, or are we still awaiting response?

If there is no change in the status of this bug over the next two weeks, this bug will be marked as NORESPONSE.
Comment 3 PJ 2013-12-05 18:34:18 UTC
This bug has not been changed from the NEEDINFO state since my previous comment, marking as RESOLVED NORESPONSE.

Please feel free to REOPEN this bug at any time if you are still experiencing the issue. Please add the requested information and set the bug back to the NEW (or CONFIRMED) state.