473,419 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

Sending https:// Request in .Net Compact Framework 2.0

Hi All,

I am trying to send an https:// request from my .Net CF application. The code is as follows :

try
{
HttpWebRequest request = ( HttpWebRequest )
WebRequest.Create( https://www.anyServer.com );

request.Method = "GET";

HttpWebResponse webResponse =
( HttpWebResponse )request.GetResponse();
}
catch( WebException e1 )
{
MessageBox.Show( e1.Message );
}


After sending the request im getting an exception that says "trust failure". I know that it is because of the root certificate is not installed on the device root certificate store.

But if I want to validate server sertificate on the device, than how can I do this ?
How can I read the certificate infomration sent by server to device ?


Thanks in advance.
Apr 26 '07 #1
3 1669
radcaesar
759 Expert 512MB
Are you running the Application in the default ASPNET account ?
Apr 26 '07 #2
radcaesar
759 Expert 512MB
Refer this for your error. You will resolve if my assumption was correct on your exception.

http://msdn2.microsoft.com/en-us/library/aa302408.aspx

:)
Apr 26 '07 #3
Are you running the Application in the default ASPNET account ?

Hi Red,

Sorry for posting the question twice !!

Actually Im trying it from a .Net Compact Framework Application with a PocketPc 2003 Second Edition device.

I have found some solutions. It might be because of the CA certificate was not installed on my device. When I sent the request to server for which a CA certificate is there on ny device, it worked fine.

But still I have some problems. The source is as follows

ServicePointManager.CertificatePolicy = new MyPolicy();

class MyPolicy : ICertificatePolicy
{
public bool CheckValidationResult( ServicePoint srvPoint,
X509Certificate certificate, WebRequest request, int certificateProblem )
{
return true;
}
}

My problem is that for any situation this code will always return "true".
can you suggess:

1) how can I store my own certificate on device.
2) how can I validate the server certificate against my own certificate.

Thanks in advance.
Apr 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Ashutosh Bhalerao | last post by:
Hi all, I am trying to write a VB.Net application which communicates over SSL with an IIS server. I have got a temporary certificate from Verisign and installed it on IIS. I am using...
9
by: Michael Evanchik | last post by:
Hello all, since i wanted to use ssl and its seems easy to do so with this object. Im trying to login to a webserver (aol) for this example. But for some reason, im packet sniffing with ethreal...
4
by: Molina | last post by:
Hi !!! I have a VB.Net application that consumes an WebService. The problem is that the HTTP address works fine, but it will change to an HTTPS address, and it isn't working. The weird thing...
2
by: MarkAurit | last post by:
I have a web service Im using on a machine via http in a dmz that works file. Im now attempting to use it in a second server, this one using https. When I attempt to add the Web Reference in vs.net...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
2
by: Greg Wood | last post by:
As a new member, I hope I am posting correctly. Bear with me if not ! I found a posting by Earle Oxner that very closely matches the situation we are in. Sadly, there were no replies to his post,...
2
by: barrybevel | last post by:
Hi, I have a very small simple program below which does the following: 1) post a username & password to a website - THIS WORKS 2) follow a link - THIS WORKS 3) update values of 2 fields and...
1
by: m2abhi25 | last post by:
Hi All, I am trying to send an https:// request from my .Net CF application. The code is as follows : try { HttpWebRequest request = ( HttpWebRequest ) WebRequest.Create(...
5
by: lanclot | last post by:
hi i am trying to authenticate a user using ClientLogin by sending a post to https://www.google.com/accounts/ClientLogin in my c program use ssl and socket the next code is my request:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.