-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global DLL Handlers implementation #321
base: master
Are you sure you want to change the base?
Conversation
Exit; | ||
end; | ||
{$ENDIF} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the 2 global handles have been assigned, exiting here will bypass Indy's initialization of OpenSSL's thread-locking callbacks. Are you sure this is intended behavior?
Exit; | ||
end; | ||
{$ENDIF} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the 2 global handles have been assigned, exiting here will bypass Indy's cleanup of OpenSSL's thread-locking callbacks. Are you sure this is intended behavior?
hIdCrypto : TIdLibHandle = IdNilHandle; | ||
|
||
{$ENDIF} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the point of declaring getter/setter functions if you are also making the variables themselves public as well? The variables should not be in the interface
, only the implementation
.
{CH fn_NCONF_load_bio = 'NCONF_load_bio';} {Do not localize} | ||
{CH fn_NCONF_get_section = 'NCONF_get_section';} {Do not localize} | ||
{CH fn_NCONF_get_string = 'NCONF_get_string';} {Do not localize} | ||
{CH fn_NCONF_get_number_e = 'NCONF_get_number_e';} {Do not localize} | ||
{CH fn_NCONF_dump_fp = 'NCONF_dump_fp'; } {Do not localize} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated this change into the master
code. Please resync your PR.
@@ -19730,7 +19794,7 @@ function GetCryptLibHandle : TIdLibHandle; | |||
{CH fn_CRYPTO_pop_info = 'CRYPTO_pop_info'; } {Do not localize} | |||
{CH fn_CRYPTO_remove_all_info = 'CRYPTO_remove_all_info'; } {Do not localize} | |||
{CH fn_OpenSSLDie = 'OpenSSLDie'; } {Do not localize} | |||
{CH fn_OPENSSL_ia32cap_loc = 'OPENSSL_ia32cap_loc'; { {Do not localize} | |||
{CH fn_OPENSSL_ia32cap_loc = 'OPENSSL_ia32cap_loc';} {Do not localize} | |||
{CH fn_CRYPTO_get_new_lockid = 'CRYPTO_get_new_lockid'; } {Do not localize} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated this change into the master
code. Please resync your PR.
{CH fn__ossl_old_des_string_to_2keys = '_ossl_old_des_string_to_2keys';} {Do not localize} | ||
{CH fn__ossl_old_des_cfb64_encrypt = '_ossl_old_des_cfb64_encrypt';} {Do not localize} | ||
{CH fn__ossl_old_des_ofb64_encrypt = '_ossl_old_des_ofb64_encrypt';} {Do not localize} | ||
{CH fn__ossl_096_des_random_seed = '_ossl_096_des_random_seed';} {Do not localize} | ||
{$ENDIF} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated these changes into the master
code. Please resync your PR.
@@ -20764,7 +20828,7 @@ function GetCryptLibHandle : TIdLibHandle; | |||
{CH fn_ASN1_mbstring_copy = 'ASN1_mbstring_copy'; } {Do not localize} | |||
{CH fn_ASN1_mbstring_ncopy = 'ASN1_mbstring_ncopy'; } {Do not localize} | |||
{CH fn_ASN1_STRING_set_by_NID = 'ASN1_STRING_set_by_NID'; } {Do not localize} | |||
{CH fn_ASN1_STRING_TABLE_get = 'ASN1_STRING_TABLE_get'; {Do not localize} | |||
{CH fn_ASN1_STRING_TABLE_get = 'ASN1_STRING_TABLE_get';} {Do not localize} | |||
{CH fn_ASN1_STRING_TABLE_add = 'ASN1_STRING_TABLE_add'; } {Do not localize} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated this change into the master
code. Please resync your PR.
@@ -22082,7 +22146,7 @@ function GetCryptLibHandle : TIdLibHandle; | |||
{CH fn_SSL_use_RSAPrivateKey_ASN1 = 'SSL_use_RSAPrivateKey_ASN1'; } {Do not localize} | |||
{$ENDIF} | |||
{CH fn_SSL_use_PrivateKey = 'SSL_use_PrivateKey'; } {Do not localize} | |||
{CH fn_SSL_use_PrivateKey_ASN1 = 'SSL_use_PrivateKey_ASN1'; {Do not localize} | |||
{CH fn_SSL_use_PrivateKey_ASN1 = 'SSL_use_PrivateKey_ASN1';} {Do not localize} | |||
{CH fn_SSL_use_certificate = 'SSL_use_certificate'; } {Do not localize} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated this change into the master
code. Please resync your PR.
@@ -22437,7 +22501,7 @@ function GetCryptLibHandle : TIdLibHandle; | |||
{CH fn_ENGINE_register_RAND = 'ENGINE_register_RAND'; } {Do not localize} | |||
{CH fn_ENGINE_unregister_RAND = 'ENGINE_unregister_RAND'; } {Do not localize} | |||
{CH fn_ENGINE_register_all_RAND = 'ENGINE_register_all_RAND'; } {Do not localize} | |||
{CH fn_ENGINE_register_STORE = 'ENGINE_register_STORE'; { {Do not localize} | |||
{CH fn_ENGINE_register_STORE = 'ENGINE_register_STORE'; } {Do not localize} | |||
{CH fn_ENGINE_unregister_STORE = 'ENGINE_unregister_STORE'; } {Do not localize} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have incorporated this change into the master
code. Please resync your PR.
Greetings, I apologize if this is not the right space, as I didn't see the follow-up to https://www.atozed.com/forums/thread-1936.html in the open issues list here on GitHub. I would be interested in testing this fix when you believe it's ready. I recently had the same error as described in the forum thread, being unaware of issues unloading the OpenSSL DLLs from memory. In my application, I have a Delphi 2007 service running an Indy HTTPS server that dynamically loads a DLL (in 2007 as well, but never unloaded) to execute functions that also load/unload a secondary DLL (built in Delphi 10.4) that executes HTTPS REST calls to 3rd party web services. When the 2nd DLL unloads, it causes the HTTPS service to be unable to make its own outbound HTTPS calls, with the error you are trying to fix with this pull request here, then eventually breaks down where the service can't receive HTTPS requests, either. To get around the issue, and prevent loading/unloading of OpenSSL, we tried statically linking the 2nd DLL functions to the HTTPS service (first opportunity to load in the process), and used the statically linked functions in the 1st DLL. That appeared to work in our testing environment, preventing Indy from unloading and causing the error (we are preparing to test this in or Beta environment soon). If the solution in this pull request is better, I would be highly interested in testing it, if possible with Delphi 2007. But, I have some follow up questions in how to pull the correct code. When Indy was hosted in SVN, we pulled the stable tagged versions of Indy to rebuild with our exe's. Since the move to GitHub, I am unsure how to get the stable versions released, and just lace in the fixes we need with the particular version of Delphi, or do we simply always get the master copy? Our only other alternative to get around the problem is to move our service to Delphi 10.4 (in the works, but not ready) so we don't need the 2nd DLL for REST calls. |
I don't have an ETA on that. However, I was looking at this PR the other day to evaluate how feasible it is to include in the current version, or if it should wait for a future release.
Even in SVN, there were no "stable" releases, only tags for which revision was included in which Delphi version. However, since the switch to GitHub, Embarcadero hasn't been giving me the commit IDs they pull for each release, so I haven't been able to tag them anymore. Eventually, I will make real versioned and tagged releases of Indy in GitHub, but that hasn't been implemented yet (see #328).
Just pull the master code for now. |
Please, find attached global OpenSSL dll handlers implementation.
I also did some miss comment brackets which causes lazarus editor to do incorrect highlighting.