B
Benjamin Lukner
Hi!
In short:
Does CF2 throw an exception even if it only receives a certificate?
I have to connect to a customer's host via https.
Due to CF2 not supporting certificates the customer switched from
certificate to username/password authentication.
This works fine in Full Framework (and also CF3.5), but when using CF2
SP2 I get an exception stating that client side certificates are not
supported.
Is there some kind of property I can set to bypass the problem?
Or is the exception always thrown even if only the host sends a
certificate to identify itself (I ignore that certificate)?
I think I included all currently known hacks and workarounds...
The exception is thrown on the last line of the snippet:
const string URL = "xxx";
const string USR = "xxx";
const string PWD = "xxx";
NetworkCredential nc;
HttpWebRequest request;
HttpWebResponse response;
StreamReader sr;
StringBuilder sb;
System.Net.ServicePointManager.CertificatePolicy
= new TrustAllCertificatePolicy();
nc = new System.Net.NetworkCredential(USR, PWD);
request = (HttpWebRequest)HttpWebRequest.Create(URL);
request.Credentials = nc;
request.AllowWriteStreamBuffering = true; //Bug workaround
request.Timeout = 60000;
response = (HttpWebResponse)request.GetResponse();
Kind regards,
Benjamin Lukner
In short:
Does CF2 throw an exception even if it only receives a certificate?
I have to connect to a customer's host via https.
Due to CF2 not supporting certificates the customer switched from
certificate to username/password authentication.
This works fine in Full Framework (and also CF3.5), but when using CF2
SP2 I get an exception stating that client side certificates are not
supported.
Is there some kind of property I can set to bypass the problem?
Or is the exception always thrown even if only the host sends a
certificate to identify itself (I ignore that certificate)?
I think I included all currently known hacks and workarounds...
The exception is thrown on the last line of the snippet:
const string URL = "xxx";
const string USR = "xxx";
const string PWD = "xxx";
NetworkCredential nc;
HttpWebRequest request;
HttpWebResponse response;
StreamReader sr;
StringBuilder sb;
System.Net.ServicePointManager.CertificatePolicy
= new TrustAllCertificatePolicy();
nc = new System.Net.NetworkCredential(USR, PWD);
request = (HttpWebRequest)HttpWebRequest.Create(URL);
request.Credentials = nc;
request.AllowWriteStreamBuffering = true; //Bug workaround
request.Timeout = 60000;
response = (HttpWebResponse)request.GetResponse();
Kind regards,
Benjamin Lukner