Re: TrustFailure accessing web service from Smart Device application.
From: Chris Botha (chris_s_botha_at_hotmail.com)
Date: 08/28/03
- Previous message: Joe: "Re: C# Zip"
- In reply to: John Hynes: "TrustFailure accessing web service from Smart Device application."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Thu, 28 Aug 2003 16:55:58 -0400
The reason why you web service call fails, is because of the fact that "the
certificate name doesn't match the server name".
This is true for desktop web service calls as well. If you use IE, pocket or
desktop, and it comes back with that message, you will not be able to call
web services on that server using SSL.
The reason why "the certificate name doesn't match the server name", is what
it says. If your computer is www.mywebsite.com, then your certificate must
be made out to www.mywebsite.com as well. I'm not sure if this can be
achieved by generating your own test certificates for your test server, but
ask on the IIS newsgroups.
"John Hynes" <john@hynes.plus.com> wrote in message
news:rLn3b.956$4L1.168580@wards.force9.net...
> I have a web service which is set up to require SSL and basic
> Authentication.
>
> I can access this service from the browser on a PocketPC device - it
prompts
> me to confirm that I will accept the certificate as the name doesnt match
> the server name (don't know why!), then prompts me for network username
and
> password, then displays the web services - no problem.
>
> I have a Smart Device application which tries to access the web service by
> setting up a NetworkCredential object then calling a method on the web
> service. It throws an exception "Could not establish trust relationship
with
> remote server".
>
> If I remove the requireSSL option, and rebuild the application with http
> rather than https everything works OK.
>
> Anyone know why this works from the browser but not the application?
>
> Code is fairly simple:
>
> MobileService ms = new MobileService();
> ms.Timeout=10000;
> ms.Url = "https://.....";
> ms.Credentials = new NetworkCredentials( username, password, domain );
> ms.PreAuthenticate = true;
> ms.MyMethod( ... ); --> this throws an exception
>
> Thanks
> John
>
>
- Previous message: Joe: "Re: C# Zip"
- In reply to: John Hynes: "TrustFailure accessing web service from Smart Device application."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|