X509Certificate2使IIS崩溃 [英] X509Certificate2 makes IIS crash

查看:591
本文介绍了X509Certificate2使IIS崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在newing了X509Certificate2实例(字符串,字符串)我的IIS进程只是崩溃。没有的.NET异常,什么都没有,这只是我的事件日志

When newing up an instance of X509Certificate2(string, string) my IIS process simply crashes. No .Net exception, no nothing, except of this in my event log

Faulting application name: w3wp.exe, version: 8.0.9200.16384, time stamp: 0x50108835
Faulting module name: ntdll.dll, version: 6.2.9200.16420, time stamp: 0x505ab405
Exception code: 0xc0000374
Fault offset: 0x00000000000ea485
Faulting process id: 0x102c
Faulting application start time: 0x01ce10301e250c4d
Faulting application path: c:\windows\system32\inetsrv\w3wp.exe
Faulting module path: C:\Windows\SYSTEM32\ntdll.dll
Report Id: 5e55321c-7c23-11e2-93f9-00155d8a0f17
Faulting package full name: 

林pretty的目瞪口呆,不知道从哪里开始寻找。当附加调试器的过程中,我能够对这个换行,但跨过它时,整件事崩溃。

Im pretty stunned and don't know where to start looking. When attaching a debugger to the process, i'm able to break unto this line, but when stepping over it the the whole thing crashes.

    _certificate = new X509Certificate2(pfxFile, pfxPassword);

pfxFile是一个有效的路径,如果我改变它,我立即得到一个正确的.Net PathNotFound例外。

pfxFile is a valid path, if i change it i immediately get a correct .Net PathNotFound exception.

服务器是Windows 2012,运行IIS8和.NET 4.5。

Server is Windows 2012, running IIS8 and .Net 4.5.

更新:<一href="http://connect.microsoft.com/VisualStudio/feedback/details/790360/ssl-certificates-wont-load-into-an-iis-worker-process-unless-loaduserprofile-is-enabled">This文章描述了同样的问题,其中一个解决方法是,以确保应用程序池身份使LoadUserProfile

Update: This article describes the same problem where a solution is to make sure the App Pool identity has LoadUserProfile enabled.

推荐答案

我也有类似的问题,也是Windows Server 2012中,它坠毁IIS上,在使用

I had a similar problem, also on Windows Server 2012, which crashed IIS, when using

new X509Certificate2(fileName, keyPassword, X509KeyStorageFlags.Exportable)

这是固定的,通过改变构造

This was fixed by changing the constructor to

new X509Certificate2(fileName, keyPassword, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable)

这篇关于X509Certificate2使IIS崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆