다음 문제가 발생했습니다.IIS 풀의 LoadUserProfile을 설정하면 정확히 어떻게됩니까?
나는이 개 과정에 다음 코드
var binaryData = File.ReadAllBytes(pathToPfxFile);
var cert = new X509Certificate2(binaryData, password);
를 실행합니다. 프로세스 중 하나가 LOCAL_SYSTEM
에서 실행되며이 코드가 성공합니다.
System.Security.Cryptography.CryptographicException
Object was not found.
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromBlob(Byte[] rawData, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromBlob(Byte[] rawData, Object password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password)
//my code here
그래서 내가 조금 봤과 비슷한 질문의 종류에
this answer을 발견 : 또 다른 하나는 "사용자"로컬 그룹에 속한 로컬 사용자 계정으로 IIS 거기 나는 다음과 같은 예외가 내부 실행합니다. 응용 프로그램 풀에 대해
LoadUserProfile
을 사용하려고 시도했지만 현재 작동합니다.
문제는 내가 정확히 LoadUserProfile
을 설정하고 어떤 결과가 있었는지 알 수 없기 때문입니다. 나는 이것이 "좋은"것이라면 왜 기본적으로 "켜져 있지"않고 왜 결국 거기에있는 것입니까?
LoadUserProfile
을 IIS 풀에 설정하면 어떤 일이 발생하며 어떤 부작용이있을 수 있습니까?
사용자 프로필을로드하는 것이 문제가된다면 인증서로드를 새 X509Certificate2 (binaryData, password, X509KeyStorageFlags)로 변경할 수 있습니다.MachineKeySet)'을 사용하여 사용자 프로파일이 필요하지 않습니다. – vcsjones