Windows Server 2016 IIS 10 WCF service call fails with "Could not establish secure channel" - wcf

I have a .NET 4.5 web application that runs fine on a Windows Server 2012 R2 machine, however it won't function when deployed on a Windows Server 2016 machine.
The application interacts with a rather old Ejbca installation utilizing its web service interface.
The application works perfectly fine when deployed on a Windows Server 2012 R2 machine in IIS 8.5.9600.
When deployed on a newer machine - Windows Server 2016 in IIS 10.0, any calls to that web service fail with the following exception:
<InnerException>
<HelpLink i:nil="true"/>
<InnerException i:nil="true"/>
<Message>The request was aborted: Could not create SSL/TLS secure channel</Message>
<StackTrace>at System.Net.HttpWebRequest.GetResponse()
at System.ServiceModel.Channels.HttpChannelFactory`1.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
</StackTrace>
<Type>System.Net.WebException</Type>
</InnerException>
What could be the reason for this behavior?

Related

webservice stopped working after moved from Windows Sever 2012R2 to 2019

I have one old wcf developed with .Net Framework 4.0 and was hosted on Windows Sever 2012 R2.
It was working fine but after server upgrade to Windows Sever 2019, it is throwing following error:
An error occurred while making the HTTP request to
https://prod1-a1:8086/MainAuthService/Authentication.svc. This could be due to the fact that the
server certificate is not configured properly with HTTP.SYS in the
HTTPS case. This could also be caused by a mismatch of the security
binding between the client and the server.
IIS version is 10.
It is first time I am working with web service and I don't have clue. I don't have access to code but any help would be appreciable.
Finally I was able to resolve it by using full domain name with URL which has https.
https://prod1-a1:8086.pisc.com/MainAuthService/Authentication.svc.

WCF goes offline automatically

I have hosted a WCF service application on IIS8 (Windows Server 2012 R2). These services automatically goes offline sometimes an the other applications which uses these services throw this error,
The requested service, 'http://10.230.245.156:8086/Apis/ILQ/Services/ILQInfoService.svc' could not be activated. See the server's diagnostic trace logs for more information.
When I open the Web.config of the WCF application and save it again, the services starts working back again.

WCF 4.5 Web service hosted on IIS 7.5 on Windows Server 2012 gives an exception

I am getting a ProtocolException when using a WCF Service targeting .NET framework 4.5 on IIS7.5 on a Windows Server 2012 box.
The remote server returned an unexpected response: (405) Method Not Allowed.
Any pointers to the problem would help as it works okay in Development env.
I can browse to the service's svc file in the browser but when invoked from a website on the same box, it gives this error.

System.Net.WebException: The remote server returned an error: (401) Unauthorized in WCF hosted in Windows Service

I have a WCF service which is hosted in Windows Service and windows service is running with "Local System Account". Service is trying to download a file from SharePoint server and failed with error:
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.WebClient.DownloadFile(Uri address, String fileName)
at System.Net.WebClient.DownloadFile(String address, String fileName)
Similar setup is working in another machine and service is able to communicate with Sharepoint site but not in my server. I have tried this setup in another machine but same error except one machine.
What kind of permissions are required to communicate with SharePoint? Also, how can I check what are the credential passed during request?
If certificates are involved here, see if this is a certificate issue. Use the MMC snap-in and compare the certs on the working and non-working machines.

.net 4.0 on iis7 with WCF app showing NT AUTHORITY\ANONYMOUS LOGON

Dot net 4.0
IIS7
WCF app
SQL 2005 standard
App is hosted on server1 , db is hosted on server2.
Application pool using .4.0 integrated as opposed to classic.
When browsing to site i see NT AUTHORITY\ANONYMOUS LOGON.
Sorry, just figured it out.
Removed
Integrated Security=true
From web.config.
Appears the application pool identity was being passed to SQL server.