T
Tony Guidici
I have been attempting to send an XML post to a ASPX page I created as a
listener. On our Windows Server 2003 Web Edition server, I installed a test
certificate from Thawte and can hit the page just fine from the browser.
However, when I attempt to use the WebRequest object to post to the page, I
get the folowing error:
"The underlying connection was closed: Could not establish trust
relationship with remote server."
I used the following code:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(client.OutboundURL);
req.Method = "POST";
req.ContentType = "text/xml";
req.PreAuthenticate = true;
req.Credentials = new NetworkCredential(client.WebSendID,
client.WebSendPwd);
Stream xmlSend;
try
{
xmlSend = req.GetRequestStream();
}
catch(Exception ex)
{
Debug.WriteLine("Error getting stream to outbound resource.");
throw ex;
}
The code works fine if I use HTTP instead of HTTPS. I have searched Google,
MSDN, and any other source I can find, with some answers that haven;t worked
so far.
Can anyone help me?
Thanks,
Tony Guidici
President, Sr. Consultant
Vero Solutions, Inc.
listener. On our Windows Server 2003 Web Edition server, I installed a test
certificate from Thawte and can hit the page just fine from the browser.
However, when I attempt to use the WebRequest object to post to the page, I
get the folowing error:
"The underlying connection was closed: Could not establish trust
relationship with remote server."
I used the following code:
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(client.OutboundURL);
req.Method = "POST";
req.ContentType = "text/xml";
req.PreAuthenticate = true;
req.Credentials = new NetworkCredential(client.WebSendID,
client.WebSendPwd);
Stream xmlSend;
try
{
xmlSend = req.GetRequestStream();
}
catch(Exception ex)
{
Debug.WriteLine("Error getting stream to outbound resource.");
throw ex;
}
The code works fine if I use HTTP instead of HTTPS. I have searched Google,
MSDN, and any other source I can find, with some answers that haven;t worked
so far.
Can anyone help me?
Thanks,
Tony Guidici
President, Sr. Consultant
Vero Solutions, Inc.