Re: Could not establish trust relationship with remote server



ah... i spent weeks with this annoying message in the past!
i am sure you read all the standard causes of this issue already.
2 additional things to check for:
1.
One odd and interesting cause of this for me that took forever to
figure out, was that the user running the website had insufficient
rights to access the registry, which apparently is needed to retrieve
the trusted certificate, or something having to do with above process.
to troubleshoot you could make the user running the website application
that is throwing this exception ( aspnet or nt authority etc) admin,
and if that fixes it, remove the admin right, than go to
run>regedt32>edit>permissions, and add read rights for your iis user
there.
2.
another (non standard) problem that caused this for me in the past, was
that the server running behind a firewall, and the IIS user did not
attempt to go through the proxy server. the proxy settings can be
applied in registry, but to quickly test if this is the case perform
the following test:
- create a console app that consumes the remote https service
- open a website directly to that https service to ensure that you
can access it
- run the console app and see if it is successful.
- what is happening here, is that you are running that app as you, and
it is using the same proxy server you have setup in MSIE to make your
browser hit the proxy.
if you discovered that your app is working, hopefuly you have a skilled
systems group [as we did] that will apply apropriate proxy settings to
your internet user. this can be done in registry, or you can login as
that user ( you may need to change local logon policy so he's allowed
to logon ) and than change proxy settings in msie. this get's written
to registry current_user node and will be available for the furture for
that user.

hope that helps.
- Rafal


AL wrote:
Hi

I've got two web services both running on the same web server. Both web
services are accesses via https and the same root level domain.

I wrote the client application which post information to one of the web
services and depending on which method was invoked calls the second web
service for additional functionality.

I received the following error when I first wrote the client application:

The underlying connection was closed: Could not establish trust relationship
with remote server

To correct this I implemented the ICertificatePolicy interface and forced
the method to always return true. I then set the ServicePointManager's
CertificatePolicy property to an instance of the class which implements the
interface.

This resolved the problem from client perspective.

However, when the web service calls into the other web service, I get the
error as well. My resolution was to do the same from which in the primary web
service.

When I call the second web service (from the primary web service), I create
an instance of the same class and set the ServicePointManager's property.
This however does not solve the problem the same was that it does when the
client application encounters this error.

These web service are hosted within an ASP environment. I'm no expert here,
so it there some way the environment could be setup that some security
boundry is preventing the two web services from communicating correctly?

Many thanks

Al

.



Relevant Pages

  • Re: Still Need desperate help to start with ASP NET - simplified problems - HELP!!
    ... You could do it as a web service. ... The handler can draw on the webservice for information and db lookup. ... IE posts data AJAX to handler on web server ... featured application (say thick client) which does a lot of complicate ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Impersonated login to web service from outside domain
    ... the client is part of the domain group. ... : integrated windows auth fails. ... You can try creating an identical local user on the server (as the one you ... next call to the web service (ie. the process requiring the credentials to ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Unable to access AS2k from Win 2k m/c URGENT!!!!!!
    ... No, the Win2k machine just needs to have XMLA SDK and/or ADOMD.NET, MSXML4 ... > Analysis server need more credentials than specified in my ... the same machine as the ADOMD.NET client. ... Why do you need this web service ...
    (microsoft.public.data.xmlanalysis)
  • Re: Impersonated login to web service from outside domain
    ... the client is part of the domain group. ... You can try creating an identical local user on the server (as the one you ... next call to the web service (ie. the process requiring the credentials to ... Any other windows server gurus care to clarify? ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Using Microsoft Certificate Server Programatically
    ... Client contacts server (web service) with encrypted registration ... The server issues the certificate (not sure how the web service ...
    (microsoft.public.platformsdk.security)