使用证书部署出现System.Security.Cryptography.CryptographicException 错误解决方案
一、System.Security.Cryptography.CryptographicException: 找不到对象
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
at HttpService.Post(String xml, String url, Boolean isUseCert, Int32 timeout)
处理方法:
IIS 应用程序池--选中你网站的所配置的应用程序池--右键 选择 “高级配置” --将“加载用户配置文件” 设置为True 。问题解决
二、System.Security.Cryptography.CryptographicException: 用户的配置文件是临时配置文件。
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(String fileName, String password)
at HttpService.Post(String xml, String url, Boolean isUseCert, Int32 timeout)
在IIS中选择应用程序池-属性-标识-预定义帐号-本地系统或本地服务(较安全些)
附:
- LocalService -“本地服务”帐户是用户组的成员之一,它拥有与“网络服务”帐户相同的用户权限,但仅限于在本地计算机上使用。当应用程序池中的工作进程不需要访问它所运行在的 Web 服务器以外的内容时,可以使用此帐户。
- LocalSystem -“本地系统”帐户拥有所有用户权限,它是 Web 服务器上的管理员组的成员之一。应尽可能避免使用“本地系统”帐户,因为它会给 Web 服务器带来更严重的安全风险。
- NetworkService – Network Service 帐户是 Users 组的成员之一,并拥有运行应用程序所需的用户权限。通过使用计算机帐户的凭据,它可以在整个基于 Active Directory 的网络上进行交互。
使用证书部署出现System.Security.Cryptography.CryptographicException 错误解决方案的更多相关文章
- 部署时,出现用户代码未处理 System.Security.Cryptography.CryptographicException 错误解决方法
转载:http://www.cnblogs.com/jys509/p/4499978.html 在调用RSA加密的.pfx密钥时,在本地调试没有问题,可以布署到服务器,就会报以下的错误: 用户代码未处 ...
- 调用微信退款接口时,证书验证出现System.Security.Cryptography.CryptographicException: 出现了内部错误 解决办法
1.证书密码不正确,微信证书密码就是商户号 解决办法:请检查证书密码是不是和商户号一致 2.IIS设置错误,未加载用户配置文件 解决办法:找到网站使用的应用程序池-->右击-->高级设置- ...
- X509证书 指定了无效的提供程序类型 System.Security.Cryptography.CryptographicException 错误解决方法
第一种解决办法: IIS 应用程序池--选中你网站的所配置的应用程序池--右键 选择 “高级配置” --将“加载用户配置文件” 设置为True 第二种解决办法: 在加载证书方法时使用以下方法,请注意第 ...
- System.Security.Cryptography.CryptographicException 出现了内部错误
调试微信支付退款时,需要使用pfx证书,在本地调试时没有问题,但在服务器部署时报异常:System.Security.Cryptography.CryptographicException 出现了内部 ...
- WCF:System.Security.Cryptography.CryptographicException: 密钥集不存在
WCF使用IIS部署时,使用x509证书验证,在创建证书并正确配置程序后,访问出现错误提示: System.Security.Cryptography.CryptographicException: ...
- System.Security.Cryptography.CryptographicException: 指定了无效的提供程序类型
这两天在调用银联在线的支付接口,把银联提供的demo代码copy过来放到自己网站上,生成通过了,但是运行的时候就报错了: 指定了无效的提供程序类型. 说明: 执行当前 Web 请求期间,出现未经处理的 ...
- "System.Security.Cryptography.CryptographicException: 拒绝访问" 问题的解决方法
.net web程序使用rsa算法进行加解密时,程序报告“System.Security.Cryptography.CryptographicException: 拒绝访问”错.按网上搜的解决方法做了 ...
- WebApi 数据保护操作未成功。这可能是由于未为当前线程的用户上下文加载用户配置文件导致的。当线程执行模拟时,可能会出现此情况。","ExceptionType":"System.Security.Cryptography.CryptographicException","StackTrace
在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: ...
- System.Security.Cryptography.CryptographicException
在调用System.Security.Cryptography.ProtectedData.Protect方法来保护私密信息时,IIS可能会报以下错误:CryptographicException: ...
随机推荐
- Mysql 5.6 Cmake 编译安装
MySQL编译安装 环境: OS: CentOS 6.6x64 mini mysql: mysql-5.6.251. mysql 下载: http://dev.mysql.com/downloads/ ...
- jQuery版本引发的血案 iframe error 和 checkbox 无法勾选
问题介绍: 1.由于我们的项目里面用了很多Iframe,在初始话加载的时候页面就会报错.一开始调试很久没找到什么原因,看打印结果页面会被两次load,只能一步步找, 最后发现在document rea ...
- ServerInfo.INI解密
[GlobalInfo]LastServerName=000781ED2D127FBA074D97444DC82F216443034E66BB341A428B14E326A656B9LastServe ...
- 『电脑技巧』破解Win7/Win8登录密码
Pic via baidu 0x 00 破解思路 用户的明文密码经过单向Hash加密生成Hash散列,Hash散列又被加密存放在系统盘\Windiws\System32\config文件下 要获得明文 ...
- 四句话表明JSON格式定义
(1):并列的数据之间使用逗号(",")分割: (2):键值对的映射用冒号(":")表示: (3):并列数据的集合(数组)用方括号("[]" ...
- Android之GPS应用开发
LocationManager--------------->Context.LOCATION_SERVICE LocationProvider--------------->Locati ...
- IIS not allow PUT and DELETE method
refer : http://stackoverflow.com/questions/10906411/asp-net-web-api-put-delete-verbs-not-allowed-iis ...
- Currency 货币 filter
angularjs 其实也有一个currency指令,不过好像只是换符号而已. 这里自己写了一个简单的兑换率filter <div ng-controller="ctrl"& ...
- reg51.h 详解
/* BYTE Register */ sfr P0 = 0x80; //P0口 sfr P1 = 0x90; //P1口 sfr P2 = 0xA0; //P2口 sfr P3 = 0xB0; // ...
- git中的常用指令名及其意义
add 添加新文件到 Git 代码仓库的索引中 $ git add filename mv 移动或重命名文件 $ git mv old-filename new-filename rm 从工作目录和 ...