[Mono-bugs] [Bug 351942] New: SSL POST using HTTPWebRequest has object reference error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Jan 6 21:52:59 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=351942


           Summary: SSL POST using HTTPWebRequest has object reference error
           Product: Mono: Class Libraries
           Version: 1.2.6
          Platform: i386
        OS/Version: Windows Vista
            Status: NEW
          Severity: Blocker
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at ximian.com
        ReportedBy: adam at lasys.cc
         QAContact: mono-bugs at ximian.com
          Found By: Development


Description of Problem:
When posting to a ssl enabled web site I get the following exception when
retrieving the resposne stream.

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object

Steps to reproduce the problem:
1. Create a post to a ssl web site, then use something like the following code
2.
            HttpWebRequest wreq = (HttpWebRequest)HttpWebRequest.Create(uri);
            wreq.Method = "POST";
            wreq.ContentType = "application/x-ofx";
            wreq.Accept = "application/x-ofx";
            wreq.UserAgent = "IE";
            wreq.KeepAlive = false;
            System.Net.ServicePointManager.Expect100Continue = false;
            byte[] bdata = System.Text.Encoding.ASCII.GetBytes(data);

This will blow up with or without this next line
            wreq.ContentLength = bdata.Length;


                System.IO.Stream sw = wreq.GetRequestStream();
                sw.Write(bdata, 0, bdata.Length);
                sw.Close();
3. Get the response stream
            System.Net.HttpWebResponse resp =
(HttpWebResponse)wreq.GetResponse();


Actual Results:

Unhandled Exception: System.NullReferenceException: Object reference not set to
an instance of an object


Expected Results:

A resposnse object.

How often does this happen? 

everytime

Additional Information:

This works on windows using the ms framework.  I have tested the mono version
on both suse 10.2 and windows vista with the same results. I have also tried
using the WebClient object to post to a ssl url and I receive the same
exception as if I go directly to the HttpWebRequest route.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list