1

I have a MVC page which consumes a WebService over SSL. The certificate is installed and when the application is running its able to detect the certificate.

The problem is this codes works perfectly fine in my local machine while i try to call the MVC page hosted.

But when MVC page hosted in server is called it throws an error: There was no endpoint listening at https:// that could accept the message. This is often caused by an incorrect address or SOAP action.

I found out the issue was indeed with the App Pool identity. When I changed it to run with my credentials it solved the problem. But i cannot do this in production environment.

I need to make it work with Identity : Network Service in IIS App pool.

I have tried giving permission to certificate using winhttpcertcfg for network service and that also didn't help.

Not sure what is missing.

Thanks in Advance.

Aditya
  • 173
  • 1
  • 3
  • 12
  • did you check --> http://stackoverflow.com/questions/5126490/can-i-set-identity-of-my-wcf-service-to-run-as-network-service-so-it-can-reach – rt2800 May 11 '12 at 10:09
  • Under what account has the certificate been installed on the server? Make sure that is has been installed to Local Machine Personal Store so that the network service can access the certificate – Rajesh May 11 '12 at 10:19
  • Its installed under Local Machine Personal Store. – Aditya May 11 '12 at 10:42
  • is there in web.config. – Aditya May 11 '12 at 10:44
  • Are you performing 2 way SSL, if so then the client certifiate should have been under the Local Machine Trusted People store and not Personal Store – Rajesh May 11 '12 at 11:36
  • No its not two way. And i tried adding it in personal Store. It still didn't work. – Aditya May 11 '12 at 14:27
  • If its not 2 way SSL why do you have a clientCertificate element in your config? It would be easy if you can post your config file entires for your service – Rajesh May 11 '12 at 15:15
  • 1
    adding this solved my problem: – Aditya May 11 '12 at 15:41
  • That indicates your on a network where the traffic is redirected through a proxy and hence you have to use the defaultProxy element in your config to access the service. Do post the solution as an answer and mark it as it might help others – Rajesh May 11 '12 at 15:45

1 Answers1

1

adding this solved my problem:

<system.net> <defaultProxy useDefaultCredentials="true" enabled="true"> <proxy usesystemdefault="True" proxyaddress="myproxyserver:port"; bypassonlocal="False"/> </defaultProxy> <settings> <servicePointManager expect100Continue="false" /> <ipv6 enabled="true"/> </settings> </system.net> 
jrturton
  • 118,105
  • 32
  • 252
  • 268
Aditya
  • 173
  • 1
  • 3
  • 12