Bug 316385 (MONO69118) - Accessing https: protocol raises exceptions
Summary: Accessing https: protocol raises exceptions
Status: RESOLVED INVALID
Alias: MONO69118
Product: Mono: Class Libraries
Classification: Mono
Component: Mono.Security (show other bugs)
Version: 1.1
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Sebastien Pouliot
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-05 05:29 UTC by Brian Donovan
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
tlstest.cs (9.24 KB, text/plain)
2004-11-05 21:02 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:58:01 UTC


---- Reported by devslashnull@gmail.com 2004-11-04 22:29:35 MST ----

Please fill in this template when reporting a bug, unless you know what you are doing.
Description of Problem:

I tried using the HttpWebRequest class in one of my projects to access an https: page, but I was 
given an exception. I tried using just the WebClient class in a very simple test and it also threw 
an exception.

Steps to reproduce the problem:
1. Use the WebClient class's DownloadData member to access an https: page.
2. Output the result to the Console.

Actual Results:
Unhandled Exception: System.Net.WebException: Error getting response stream: ReceiveFailure 
---> System.ObjectDisposedException: The object was used after being disposed.
in <0x00058> Mono.Security.Protocol.Tls.SslClientStream:checkDisposed ()
in <0x00088> (wrapper remoting-invoke-with-check) 
Mono.Security.Protocol.Tls.SslClientStream:checkDisposed ()
in <0x00080> Mono.Security.Protocol.Tls.SslClientStream:BeginRead 
(byte[],int,int,System.AsyncCallback,object)
in <0x000e4> System.Net.WebConnection:InitRead (object)
--- End of inner exception stack trace ---

in <0x0008c> System.Net.HttpWebRequest:CheckFinalStatus (System.Net.WebAsyncResult)
in <0x000a8> (wrapper remoting-invoke-with-check) System.Net.HttpWebRequest:
CheckFinalStatus (System.Net.WebAsyncResult)
in <0x00244> System.Net.HttpWebRequest:EndGetResponse (System.IAsyncResult)
in <0x000b0> System.Net.HttpWebRequest:GetResponse ()
in <0x00064> System.Net.WebClient:DownloadData (string)
in <0x000a8> (wrapper remoting-invoke-with-check) System.Net.WebClient:DownloadData 
(string)
in <0x00064> TestSSL:Main (string[])

Expected Results:
The contents of the url.

How often does this happen? 
Every time.

Additional Information:
Accessing the internet through Airport using WEP.



---- Additional Comments From devslashnull@gmail.com 2004-11-04 22:59:35 MST ----

Test case:
using System;
using System.Net;

public class TestSSL {
	public static void Main( string[] args ) {
		WebClient web = new WebClient();
		Console.WriteLine( 
System.Text.Encoding.ASCII.GetString( web.DownloadData( 
"https://www.paypal.com/" ) ) );
	}
}




---- Additional Comments From sebastien@ximian.com 2004-11-05 13:56:30 MST ----

Have you added the CA certificate to your root store ?
If not look at "man certmgr".

Note: As an alternative you can also write an ICertificatePolicy
object to accept the certificate on your own rules.

If so (or if it doesn't work) it may be an endianness issue (I'm
fixing them right now). In this case I could send you an updated
Mono.Security.dll to test this.



---- Additional Comments From sebastien@ximian.com 2004-11-05 14:02:11 MST ----

Actually tlstest.exe works for me on a G5.

mono tlstest.exe --show https://www.paypal.com

I attached a copy of tlstest.cs if you want to try it or see how a
ICertificatePolicy is implemented.

tlstest.cs needs to be compiled with
/r:System.dll /r:Mono.Security.dll



---- Additional Comments From sebastien@ximian.com 2004-11-05 14:02:50 MST ----

Created an attachment (id=166999)
tlstest.cs




---- Additional Comments From devslashnull@gmail.com 2004-11-05 21:59:47 MST ----

Wow, thanks Sebastien. It works on mine too. I'm not sure what to do
with this bug. You can go ahead and resolve it to whatever it needs to
be resolved to.



---- Additional Comments From sebastien@ximian.com 2004-11-06 11:12:04 MST ----

Closing

Imported an attachment (id=166999)

Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>Mac OS 10.3.5</cf_op_sys_details>
Unknown operating system unknown. Setting to default OS "Other".