HTTPS (SSL) on PPC

G

Guest

Hi there,

I am trying to implement my own certificate verification process in my app
(as we use in-house certificates for our web server). I am using .NET CF SP2
on my device and emulator.

I am getting a "A blocking operation is currently executing" exception when
I try to connect to the server using WebRequest.GetRequestStream()

Does anybody know what's wrong with the way I am doing it.

A step by step descritption of my code: (.NET CF SP2)
1. On App Start I register my custom "ICertificatePolicy" implementation
with the Service Point Manager's Certificate policy. Currently I accept all
certificates blindly (return true in "CheckValidationResult" function)
2. On a button click I Create a WebRequest object from the URL (with
https://), and assign the data and data length to it. Additional properties I
set are KeepAlive=False, and Method="POST".

I get an exception of "A blocking operation is currently executing" when I
do a WebRequest.GetRequestStream(). If I click the button over a couple of
times, the exception thrown changes to a TimeOut exception.

Can anybody lead me to pointers as to why this is happening?

TIA
PB.
 
G

Guest

I still get the exception. Here's the piece of my code:

[Begin]

req = WebRequest.Create(wsUrl);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
((HttpWebRequest)req).KeepAlive = false;
((HttpWebRequest)req).AllowWriteStreamBuffering = true;
req.Timeout = 20000;

byte[] encodedPLoad = Encoding.UTF8.GetBytes(pLoad);

Stream reqStream = req.GetRequestStream();
reqStream.Write(encodedPLoad, 0, encodedPLoad.Length); //The exception
occurs right here.
reqStream.Close();
....
[End]

The exception I get is "A blocking operation is currently executing".
If I return false in my CheckValidationResult funtion, I get the trust
failed error promptly. But when I change it to true, I get the exception.

This code has been working great for atleast 6-8 months now without SSL. I
was in a process to upgrade to support SSL in the app.

FYI: The app submits a POST request and gets a stream of XML from the
ASP.NET Web Services app running on the server.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top