简体   繁体   English

将ASP.NET站点升级到.NET 4后,SSPI协商失败错误

[英]SSPI negotiation failed error after upgrading ASP.NET site to .NET 4

This error comes up when the site is deployed on the server, but works correctly on my dev box. 当站点部署在服务器上时出现此错误,但在我的开发箱中可以正常工作。

Let me provide some quick background on how everything is setup. 让我提供一些有关如何设置所有内容的快速背景。

The application ( WebApp ) is deployed to a Windows Server 2008 SP2 running IIS 7.0. 该应用程序( WebApp )部署到运行IIS 7.0的Windows Server 2008 SP2。 There are two applications within the site: WebApp and WebService . 该站点内有两个应用程序: WebAppWebService The server is not part of a domain, but is on the local network. 该服务器不是域的一部分,但是在本地网络上。

WebService contains a WCF webservice (svc) and has not be modified. WebService包含WCF Web服务(svc),尚未修改。 I can connect to this and use it as expected. 我可以连接到它并按预期使用它。

I upgraded WebApp to ASP.NET 4 from ASP.NET 3.5 sp1, which has a client proxy to the WCF webservice (generated by adding a service reference). 我将WebApp从ASP.NET 3.5 sp1升级到ASP.NET 4,该服务器具有WCF Web服务的客户端代理(通过添加服务引用生成)。 Prior to upgrading everything worked correctly. 升级之前,一切正常。 After upgrading, I can run it and use it correctly from my dev box (on a domain) and it can use WebService as expected. 升级后,我可以运行它并在我的开发框中(在域上)正确使用它,并且它可以按预期使用WebService When I deploy the site to the server and access it, I get the following error ( updated with the stack trace, only included the first line after each message ): 当我将站点部署到服务器并访问它时,出现以下错误( 使用堆栈跟踪更新,仅在每条消息之后包括第一行 ):

[Win32Exception (0x80004005): The Security Support Provider Interface (SSPI) negotiation failed.]
System.ServiceModel.Security.WindowsSspiNegotiation.GetOutgoingBlob(Byte[] incomingBlob, ChannelBinding channelbinding, ExtendedProtectionPolicy protectionPolicy) +3705927

[SecurityNegotiationException: SOAP security negotiation with 'http://server.mydoamin.com/WebService/TestService.svc' for target 'http://server.mydoamin.com/WebService/TestService.svc' failed. See inner exception for more details.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +9464367

[HttpException (0x80004005): SOAP security negotiation with 'http://server.mydoamin.com/WebService/TestService.svc' for target 'http://server.mydoamin.com/WebService/TestService.svc' failed. See inner exception for more details.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9028953

[HttpException (0x80004005): SOAP security negotiation with 'http://server.mydoamin.com/WebService/TestService.svc' for target 'http://server.mydoamin.com/WebService/TestService.svc' failed. See inner exception for more details.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +8950644

The only change I made in IIS was to set the app pool to .NET 4. 我在IIS中所做的唯一更改是将应用程序池设置为.NET 4。

I've tested and can connect and use the WebService from a non-domain computer without any issues. 我已经测试过了,可以从非域计算机上连接和使用WebService ,而不会出现任何问题。 And it works fine from my dev box (on the domain). 它在我的开发箱中(在域上)运行良好。

I am using wsHttpBinding and authenticating with a username/password of a local (to the server) windows user account. 我正在使用wsHttpBinding,并使用本地(到服务器)Windows用户帐户的用户名/密码进行身份验证。 I set the user/password on the ClientCredentials.Windows.ClientCredential property of the client proxy. 我在客户端代理的ClientCredentials.Windows.ClientCredential属性上设置用户/密码。

Here is my security config under the client binding (it's all auto-gen, I didn't modify it from adding the service reference): 这是客户端绑定下的我的安全配置(全是自动生成的,我没有通过添加服务引用来对其进行修改):

<security mode="Message">
  <transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
  <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true"/>
</security>

Again, everything works correctly if the asp.net site is run from somewhere other than on the server. 同样,如果从服务器以外的其他位置运行asp.net站点,则一切正常。

I'd appreciate any suggestions. 我将不胜感激任何建议。 Thanks! 谢谢!

Try to re-install the .net4 distribution file. 尝试重新安装.net4分发文件。 Sometimes, when you enable some .net3.5 function will cause strange problems. 有时,启用某些.net3.5功能会导致奇怪的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM