2

all,

I'm looking into OpenSSL.NET and have hit a bit of a wall with it. As I said, I'm only looking into it, but a project at work needs to use it, so I can't really use anything else. The problem I'm getting is that I'm using the Cipher attribute to select an encyption type, yet each one throws the following error:

The type initializer for 'OpenSSL.Crypto.Cipher' threw an exception.

Also, when I look at the debugger, each Cipher has "null" as it's value. I've got the ManagedOpenSsl.dll referenced, and libeay32.dll and ssleay32.dll are both in the working directory, so I'm a tad stuck.

Any help on this would be much appreciated. Also, has anyone found any good stuff to read on the OpenSSL library? I've spent two hours looking, but nothing useful shows up.

Cheers

Skulmuk
  • 587
  • 4
  • 8
  • 19
  • 1
    You need to post the `InnerException`. – CodesInChaos Jul 17 '12 at 11:31
  • It's possible you're running into the `cdecl` vs. `stdcall` import signature issue. – CodesInChaos Jul 17 '12 at 11:32
  • 1
    Anything SSL related in .net sucks. OpenSSL.NET has several severe bugs, .net's built in implementation doesn't allow you to enforce the use of secure cipher suites, Mono doesn't support secure cipher suites in the first place, BouncyCastle is client only, and GnuTLS has no bindings. – CodesInChaos Jul 17 '12 at 11:35
  • Thanks. Is there anything you can suggest then? The library needs to be used is all (I've tried to override the signature import, but to no avail). – Skulmuk Jul 17 '12 at 11:44
  • 1
    What library you should use depends on your exact requirements. But if you want to figure out what the issue with OpenSSL.NET is, you need to find the InnerException. – CodesInChaos Jul 17 '12 at 11:46
  • 1
    Found the error using dtb's answer listed at the following [link](http://stackoverflow.com/questions/3876456/how-do-i-find-the-inner-most-exception-without-using-a-while-loop). Thanks for the advice, Chaos ;) – Skulmuk Jul 17 '12 at 11:56
  • If you're using a debugger you can simply view it in the exception details dialog. No need to code anything. – CodesInChaos Jul 17 '12 at 11:59

0 Answers0