|
Forums -> Security Library Forum
Couldn't acquire crypto service provider context |
|
|
by Jeff Duty [jduty at ardeotech dot com] posted on 2004/05/24 |
|
I get this error on one server but not another?
Couldn't acquire crypto service provider context.
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: Couldn't acquire crypto service provider context.
Source Error:
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: Couldn't acquire crypto service provider context.]
Org.Mentalis.Security.Cryptography.CAPIProvider.CreateHandle() +367
Org.Mentalis.Security.Certificates.Certificate.get_PublicKey() +71
Org.Mentalis.Security.Ssl.Shared.ClientHandshakeLayer.ProcessServerHelloDone(HandshakeMessage message) +250
Org.Mentalis.Security.Ssl.Shared.ClientHandshakeLayer.ProcessMessage(HandshakeMessage message) +129
Org.Mentalis.Security.Ssl.Shared.HandshakeLayer.ProcessMessages(RecordMessage message) +232
Org.Mentalis.Security.Ssl.Shared.RecordLayer.ProcessBytes(Byte[] buffer, Int32 offset, Int32 size) +362
Org.Mentalis.Security.Ssl.Shared.CompatibilityLayer.ProcessServerHello(Byte[] bytes, Int32 offset, Int32 size) +475
Org.Mentalis.Security.Ssl.Shared.CompatibilityLayer.ProcessHello(Byte[] bytes, Int32 offset, Int32 size) +28
Org.Mentalis.Security.Ssl.Shared.SocketController.OnReceive(IAsyncResult ar) +110
[SecurityException: An error occurs while communicating with the remote host.]
Org.Mentalis.Security.Ssl.SecureSocket.EndSend(IAsyncResult asyncResult) +194
Org.Mentalis.Security.Ssl.SecureSocket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) +72
Org.Mentalis.Security.Ssl.SecureSocket.Send(Byte[] buffer) +19
sloth.QuickLink.Send(String data) in y:\clients\sloth project\website\quicklink.cs:742
sloth.QuickLink.DoTransaction() in y:\clients\sloth project\website\quicklink.cs:629
sloth.WebForm1.Page_Load(Object sender, EventArgs e) in Y:\Clients\Sloth Project\Website\WebForm1.aspx.cs:67
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +731
Why whould I get it on one server and not the other?
Jeff
|
by Jeff Duty posted on 2004/05/24 |
|
Should mention that the servers are both win2k3 stnd.
Jeff |
by Jeff Duty posted on 2004/05/24 |
|
Not sure what I ws thinking when I posted. Here is some information on what the app is and what I have found so far.
This a asp.net 1.1 webapp (latest build of the lib). It is connecting to a merchant acccount to an ecommerce site. I created a small component to act as the connector. The connector works well in a windows (exe) app. It also works well on our sandbox in a web app, but when moved to the production box it fails with the error above. I did test the win app and it works everywhere.
So far I have tried removing the RSA directory as memtioned in a few posts and checking the permissions. So far no luck. I have traced the failure to lines 54-70 of CryptographyStructures.cs. To me it looks like it is a permission problem but I can't seem to find where the problem is.
Thanks,
Jeff |
by Jeff Duty posted on 2004/05/24 |
|
Ok, fixed.
This is a little simple but different. The production server uses a hosting controler that changed the application user of the site (not one of the standard accounts) each site gets a specific user. So it was a permissions issue.
Thanks,
Jeff |
by Chris Hudel [chris at hudel dot com] posted on 2004/05/26 |
|
How did you fix the permissions? I am running into the same problem, with a nearly identical stack trace.
Thanks,
Chris. |
by Matt Sawyer [matt dot sawyer at eds dot com] posted on 2004/06/17 |
|
I've been getting this error too. I get the error "An error occurs while communicating with the remote host" (SecurityException) with the CryptographicException as the inner exception.
I've been developing an IM/presence client that uses the Mentalis.org Security Library and have been trying to recreate the problem. I finally was able to isolate it to users changing their password.
This only occurs for users logging into a domain. When they change their Windows password, which gets changed in both Windows as well as in Active Directory, the client won't allow them to log in the next time they try. In fact, they can never log in again. Logging out of Windows, rebooting, etc. does not resolve the problem.
It appears, however, that you can connect to one server but not another. For me, or for all of my users, for that matter, they cannot connect to *any* server.
The problem always occurs in the Security\Ssl\SecureSocket.cs class in the public method int EndSend( IAsyncResult asyncResult ). The ti.AsyncResult.AsyncException is not null, hence the SecurityException being thrown. |
by Jeff [jduty at ardeotech dot com] posted on 2004/12/07 |
|
Ok, Sorry this took so long to answer, I haven't been here in a while. We were using A host controller that setup accounts name based not IP based. Because of this the web account is not given permissions to the directory (not in IIS but for the actual folder) by default. I needed to manually add the account and set the permissions to the directory for the web account. So if you are having this issue check to make sure your web user account has the correct permissions. If you are unsure about the account name look in the "Directory Security" tab for the sites permissions in IIS. If you are not in control of the box then you will need to get your host to do this for you.
I hope this helps. Feel free to email me if there are any further questions.
Jeff |
by norman [normanm at infocorp dot com dot uy] posted on 2005/08/08 |
|
Hi Jeff: i have same error. I run a component in the server remote and i have request sucefully but when i run the web application with instancial component, this error ocurred. How you solved thsi problem? Thanks. |
|
|