AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 419289
Accepted
Anarko_Bizounours
Anarko_Bizounours
Asked: 2012-08-21 06:11:58 +0800 CST2012-08-21 06:11:58 +0800 CST 2012-08-21 06:11:58 +0800 CST

将 webservice 部署到 iis 7.5 时出错

  • 772

编程部门要求我测试部署他们的一个应用程序。据我所知,关于该应用程序,它是一个用于 wpf 应用程序的 webservice wcf 代码 c#。他们确实告诉我他们确实尝试将证书直接放在 web 服务中(以避免注册 ssl 证书并将它们保存在每个客户端应用程序中的麻烦)。

到目前为止我没有问题。但是有一个小技巧。

我一直在尝试在 localhost 中部署这个东西(以确保完成它的过程),并且一切都很好(确实获得了带有此消息的成功 svc 加载页面):

blabla 成功

svcutil.exe http://###deployment.eslan2.local/Service###.svc?wsdl

C#

class Test
{
    static void Main()
    {
       //how to blabla
       client.Close();
    }
}

但是当我尝试在我的 IIS 网络服务器(带有 IIS7.5 的 ws2K8R2)上部署网络服务时,我得到了这个讨厌的但不是很有帮助的错误消息:

Server Error in '/' Application.
The specified network password is not correct.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Cryptography.CryptographicException: The specified network password is not correct.

来源错误:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[CryptographicException: The specified network password is not correct.]
   System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr) +41
   System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx) +0
   System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags) +335
   System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData) +101
   Effect.ServiceModel.ServiceBehaviorHandlerAttribute.ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) +623

[ServiceModelException: An error occurs during service management.]
   Effect.ServiceModel.ServiceBehaviorHandlerAttribute.ApplyDispatchBehavior(ServiceDescription serviceDescription, ServiceHostBase serviceHostBase) +1782
   System.ServiceModel.Description.DispatcherBuilder.InitializeServiceHost(ServiceDescription description, ServiceHostBase serviceHost) +3565
   System.ServiceModel.ServiceHostBase.InitializeRuntime() +82
   System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) +64
   System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +789
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +287
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +1132

我花了 3 天时间在网上四处寻找答案,但到目前为止没有任何有价值的东西。

我一直认为它不是来自我的服务器,而是错误来自的代码。

windows-server-2008-r2
  • 1 1 个回答
  • 2860 Views

1 个回答

  • Voted
  1. Best Answer
    Brent Pabst
    2012-08-21T06:29:01+08:002012-08-21T06:29:01+08:00

    这实际上是一个非常有用的错误消息。

    本质上,应用程序没有启动是因为“密码”不正确。然而,密码是令人困惑的部分,因为这很可能是证书指纹而不是真正的密码。第一个堆栈跟踪指向尝试读取 X509 证书的 .NET 加密提供程序。

    您的 Web 服务似乎配置为使用证书进行身份验证。可能在服务器和客户端之间,我不能确定。无论看起来如何,您都需要查看并查看您的开发环境中是否确实使用了证书。该证书可能在您的生产箱中不受信任或未正确加载。

    这就是我要从那里开始的地方。很难确切地知道您正在尝试做什么或您的代码在做什么。总的来说,它看起来是一个应用程序设置问题,这个站点对解决这个问题的帮助可能微乎其微。如果它最终没有成为证书,您可能需要请版主将问题迁移到 StackOverflow,在那里您可以获得更精确的 WCF 帮助。

    • 1

相关问题

  • Server 2008 R2 架构更改 - 自 RC 以来是否有任何更改?

  • 是否可以在 Server 2008 R2 Core Install 中安装 servermanagercmd?

  • 视窗 2008 R2 WDS

  • 从命令行备份 Windows 2008 R2 到网络共享 - 隐藏分区问题

  • 在 Windows Server 2008 上移动和更改 Pagefile.sys 大小

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve