8000 System.TypeInitializationException: 'OpenSSL.Core.Native' HRESULT: 0x800700B6 · Issue #52 · openssl-net/openssl-net · GitHub
[go: up one dir, main page]

Skip to content
8000
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
8000

System.TypeInitializationException: 'OpenSSL.Core.Native' HRESULT: 0x800700B6 #52

Open
luohuide opened this issue Sep 25, 2018 · 2 comments

Comments

@luohuide
Copy link
luohuide commented Sep 25, 2018

Hi can anyone help me? He doesn't make mistakes on all computers(windows7 or windows 10).


ERROR Message: System.TypeInitializationException: The type initializer for 'OpenSSL.Core.Native' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'x86\ssleay32': 穨╰参礚猭磅︽  (Exception from HRESULT: 0x800700B6)
at OpenSSL.Core.Native.SSL_load_error_strings()
at OpenSSL.Core.Native..cctor()
--- End of inner exception stack trace ---
at OpenSSL.Core.Native.BIO_s_mem()
at OpenSSL.Core.BIO..ctor(Byte[] buf)
at OpenSSL.Crypto.CryptoKey.FromPublicKey(String pem, String password)


I can make sure that both libeay32.dll (1.0.2a) and ssleay32.dll (1.0.2a) are under my project \x86.
I tried to revise the source code to compile it, and there was another mistake.

		// Enable FIPS mode
		if (FIPS.Enabled)
		{
			if (FIPS_mode_set(1) == 0)
			{
				throw new Exception("Failed to initialize FIPS mode");
			}
		}
	    //try
	    //{
  //          ERR_load_crypto_strings();
  //          SSL_load_error_strings();
  //      }
	    //catch (Exception)
	    //{	        
	    //}
		OPENSSL_add_all_algorithms_noconf();

		// Initialize SSL library
		Native.ExpectSuccess(**SSL_library_init()**);

System.TypeInitializationException: 'OpenSSL.Core.Native' 偺僞僀僾弶婜壔巕偑椺奜傪僗儘乕偟傑偟偨丅 ---> System.DllNotFoundException: DLL 'x86\ssleay32.dll' 傪撉傒崬傔傑偣傫:偙偺僆儁儗乕僥傿儞僌 僔僗僥儉偱偼 偼幚峴偝傟傑偣傫丅 (HRESULT 偐傜偺椺奜:0x800700B6)
応強 OpenSSL.Core.Native.SSL_library_init()
応強 OpenSSL.Core.Native..cctor()
--- 撪晹椺奜僗僞僢僋 僩儗乕僗偺廔傢傝 ---
応強 OpenSSL.Core.Native.BIO_s_mem()
応強 OpenSSL.Core.BIO..ctor(Byte[] buf)
応強 OpenSSL.Crypto.CryptoKey.FromPublicKey(String pem, String password)

@AnbuchelvanPonnusamy
Copy link

Hi Sir,

I am also faced the same issue. I am using 64 bit machine and my projects are build as "ANY CPU" mode. I was copied the libeay32.dll & ssleay32.dll from native folder/64 while I am called the native class methods its throw the same error. After copied the files from Native/84 only its worked. While i am struggling I saw this post.

@AnbuchelvanPonnusamy
Copy link

I resolved this issue. If you need a help please ping me on anbuchelvanPonnusamy@gmail.com .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0