-
Notifications
You must be signed in to change notification settings - Fork 156
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
Adding support for OpenSSL 3.x to IndySockets #575
Comments
I checked, it's working! The only thing on Windows is that it doesn't use libraries from the executable directory until you explicitly specify GetIOpenSSLDDL.SetOpenSSLPath |
This proposal will not be mergable as-is into the main Indy library, as all traces of OpenSSL are already in progress of being moved to a completely new package with its own repo: https://github.com/IndySockets/IndyTLS-OpenSSL Any further efforts to add support for OpenSSL 3.x need to be directed to that project. Version 1.0 will provide backwards compatibility of existing user code for OpenSSL 1.0.2 during this transition. Version 2.0 will then add support for OpenSSL 3.x. There is currently a branch of the main Indy library that will finalize this separation: https://github.com/IndySockets/Indy/tree/Indy-10.7 Indy 10.7 and IndyTLSOpenSSL 1.0 are pending release. |
Remy, The lack of Indy support beyond the legacy 1.0.2 (and which has been out of support since 1st Jan 2020) is now a serious problem for many developers including myself and having a version of Indy available to support OpenSSL 3.x was the motivation for my work. My proposed separate OpenSSLHeaders package also takes out of Indy all worry about support of link strategies and legacy versions. Indy need only support the OpenSSL 3.x API. Do you want me to produce a pull request to add these headers to your proposed TLS package? As for Indy 10.7, I would look to a more radical change than just making OpenSSL support a separate package. Working on it has made me realise how unwieldy it has become supporting many obscure legacy protocols. There are also units that I could find no use for or references to - some of which seemed to be uncompilable. A code tidy up is the minimum necessary. My personal preference would be to create an Indy Core package supporting the http/https stack only. Much more lightweight and focused on what most users (including myself) actually use it for (RESTful services plus JSON is my typical use). Regards Tony
|
Perhaps, but it is yet another side project to pull Indy users in another direction. There are now several separate, independent, and unrelated projects all attempting to do the same thing. I started IndyTLSOpenSSL with the intention to consolidate into 1 unified official release. No simple task.
Like earlier big-scale proposals/PRs (cough cough, #299), I simply lack the free time to review and approve them quickly. Smaller reviews are better. I will nonetheless review this one as time permits. I need to get something released sooner rather than later, and big-scale reviews keep setting me back.
I'm well aware of that. And I'm sorry it has taken as long as it has to get Indy more up to date. But I am only 1 person, with a lot on my plate outside of Indy. That's why I was happy when JP returned, since he wrote most of Indy's original OpenSSL code. But he got impatient and went off on his own and released his own project to bring OpenSSL 3.x to Indy.
Yours, and several others.
And that very well is a goal for IndyTLSOpenSSL v2.0. But I know there are a lot of Indy users, and a lot of legacy code out there. So there should be a stepping stone to prepare people for that migration. Hence IndyTLSOpenSSL v1.0. To make sure the package separation is clean and functional before then changing everything that is OpenSSL-related.
That would be ideal. Though there are already a few other PRs with different approaches, so weeding out what to merge is no simple task. And I really can't merge anything until Indy v10.7 and IndyTLSOpenSSL v1.0 are released first. I intended to do that over this recent holiday break, but that wasn't able to happen.
That is not going to happen for 10.7, or likely any 10.x version for that matter. It's too radical a change. I'm already planning bigger reorganizational changes for 11.0. But that's been in development for a long time, so I'm starting to trickle some of the pending changes into 10.x in smaller releases.
That's not likely to happen. That would defeat the purpose of the Core package. HTTP/HTTPS are protocols. Core and Protocols should stay separate.
That, on the other hand, is a more viable idea, and one I've already been considering for awhile. The Protocols package is too large for its own good. Breaking it up is a goal for a future version. |
I have to admit that I did get impatient but I'm not the only one. I have to be honest in saying that it probably may be impossible to actually reconcile several approaches towards getting OpenSSL 3.x support in Indy at this point and part of this can be attributed to the complexity of OpenSSL itself. I just simply chose my own path. That may make me "part of the problem" but I rather think the approach I took with TaurusTLS is a very sound approach. I will toot my own horn here. With TaurusTLS, I was able to the following:
TaurusTLS is available at: https://github.com/JPeterMugaas/TaurusTLS or at https://github.com/TurboPack/indy_extras . But there are some issues at my end. I have a limited amount of money, and I can't afford a MacIntosh, Android, and iOS devices so I'm not equipped to support those platforms although I am more than happy to accept contributions from others. I unlike other people have a lot of time I can devote to TaurusTLS. |
Peter,
Can you check this. I did pick up most of the changes you sent me and
incorporated several if not all the STACK_OF macros.
Tony
…On 06/01/2025 10:51, J. Peter Mugaas wrote:
I used an older version of Tony Whyman's headers with my own
modifications. In particular, I was able to solve the STACK_OF macros
as well as make more functions available. I have not reviewed the
latest work on that and at this point, I fear that I would lose some
functionality if I simply adopted the new header versions, and it
would be very complex to
|
For the STACK_OF macros I went further and applied them to a number of OpenSSL "objects". Sample code is below (pasted right from TaurusTLS):
|
I have proposed two pull requests. The first is on IndyTLSOpenSSL and copies all the OpenSSL files and Tests from my Indy.ProposedUpdate fork to IndyTLSOpenSSL. The second is a pull request on IndySockets/Indy branch 10.7. This folds in the lazarus build files from my Indy.ProposedUpdate fork and is needed to test the IndyTLSOpenSSL pull request under lazarus/fpc - apart being generally useful. |
I did bring all of these into my OpenSSL Headers, albeit under their original names. The extract below is. taken from the template headers. The generated header contains both the var and the function call variants as well as compatibility functions. function OPENSSL_sk_new(cmp:TOPENSSL_sk_compfunc):POPENSSL_STACK; {introduced 1.1.0}
|
I can see the value of both of these additions. I carefully minimised the changes to the IdSSLOpenSSL unit in order to limit the scope of the change as well as to ensure maximum backwards compatible. However, both of the above are welcome additions including moving the X.509 code into a separate unit and I would like to fold them into my pull request. The only issue is when. I can also understand Remy's point about being overwhelmed by the size of a pull request.
Again, this looks like a useful addition and I will need to look at it. |
I have published two new packages to GitHub in support of providing OpenSSL 3.x support to Indy.
Most of my work has been on creating an OpenSSL Header file code generator including support of just in time resolution of API Calls. I have also applied this work to create an up-to-date version of Indy that includes a separate OpenSSL package and supports OpenSSL 1.0.2 through to 3.x.
Any comments appreciated.
Code Generator
You can find this at https://github.com/MWASoftware/PascalAPI4OpenSSL
This is an entirely new Pascal program that processes a set of template header units to generate the actual OpenSSL Header units supporting static and dynamic linking. Although the published version does have a few OpenSSL assumptions left in it, the code generator is potentially of wider application in support of generating Pascal APIs from 'C' API header files.
I have written an accompanying User Manual that goes into the detail.
Updated Indy Package
You can find this at https://github.com/MWASoftware/Indy.proposedUpdate
Branch: OpenSSLFinal (default)
This branch is up-to-date with the current IndySockets master but otherwise separates out all OpenSSL support into a separate package (Lib/OpenSSL). It also includes the OpenSSL header files generated by the above utility. The same source code tree supports both Delphi and Lazarus/fpc.
The test programs and my own projects confirm the OpenSSL 3.x support and I am happy with the stability of the code. See the readme file for more information.
I don't propose to do any more work on this subject at present other than respond to defect reports. Otherwise it is available for anyone who is interested.
Regards
Tony Whyman
The text was updated successfully, but these errors were encountered: