-
Notifications
You must be signed in to change notification settings - Fork 138
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
libgearman patch to support SSL connections in Gearman PHP library #63
Comments
Thanks for surfacing that Ed. It would be great if you could submit it as a PR. Alexey and myself will look ASAP. |
I just tried to patch and build patched code. I'll do some tests tomorrow. |
It doesn't look very promising. No changes with regard to issue #28. I run only sequential test. So I can't say anything to issue #29 yet.
Client/Worker show on failer:
|
I wouldn't expect any changes with regard to issues #28 or #29. The purpose of the patch is to extend the API, specifically the addition of the There are at least four versions of the patch file. Which one did you use? Do you have a fork I can checkout? |
I started by the first patch. Do you have a fork I can checkout? |
I think we want the more recent patch uploaded in comment 4 at https://bugs.launchpad.net/gearmand/+bug/1338861/comments/4. In comment 6, the author says there's an even newer version, but that patch includes a lot of unrelated changes. The change to Do you think the changes to the libgearman-server files are unnecessary? |
done but I doesn't apply any changes to
I applied the patch to
@@ -393,6 +393,10 @@ static gearmand_error_t _gear_con_add(gearman_server_con_st *connection)
case SSL_ERROR_SSL:
case SSL_ERROR_ZERO_RETURN:
default:
+ if (ERR_peek_last_error())
+ {
+ cyassl_error = ERR_peek_last_error();
+ } |
Thanks, @p-alik. I'll try to compile your branch soon and test it. Sure, the libgearman-server changes seem useful. Just thought it might be beyond the scope of this issue. I have no idea how efficient Also, does Probably most of those |
CyaSSL (now called wolfSSL btw) has an OpenSSL compatibility layer. I
actually help maintain it in Debian, and it's a well cared for library
with a clear license vs. the OpenSSL license which is of questionable
origin and does not play nice with GPL. It's intention is to be
lightweight and fast, so I recommend we actually try setting up Travis
jobs to test with it.
Excerpts from Ed Sabol's message of 2016-12-12 15:56:47 -0800:
… Thanks, Andrei. I'll try to compile your branch soon and test it.
Sure, the libgearman-server changes seem useful. Just thought it might be beyond the scope of this issue.
I have no idea how efficient `ERR_peek_last_error()` is. Would it make more sense to implement it in such a way that it isn't called twice?
Also, does `ERR_peek_last_error()` work with CyaSSL?? Based on my googling, it appears to be an OpenSSL function.... Are CyaSSL and OpenSSL fully API compatible?
Probably most of those `cyassl_*` variables in libgearman-server should be renamed to `ssl_*` (as they are in libgearman). It appears as though CyaSSL support was added first and then someone added support for OpenSSL afterward.
|
While in the process of applying this patch to gearmand 1.1.15, I noticed that line 476 of libgearman/universal.cc has a change that I don't think we want. gearmand 1.1.15 has:
This patched version has
|
SSLv23_client_method() is deprecated.
TLS_client_method() is the currently favored. What I do not recall is if TLSv1_client_method() will force the client into 1.0 and not let it degrade to SSL 3, which would clearly be bad.
I cannot recall off the top of my head of the UDP code was ever merged, but if it was then that section of code should flow through a different set of functions.
— Brian
On Mar 3, 2017, at 11:25, Ed Sabol ***@***.***> wrote:
While in the process of applying this patch to gearmand 1.1.15, I noticed that line 476 of libgearman/universal.cc has a change that I don't think we want.
gearmand 1.1.15 has:
if ((_ctx_ssl= SSL_CTX_new(TLSv1_client_method())) == NULL)
This patched version has
if ((_ctx_ssl= SSL_CTX_new(SSLv23_client_method())) == NULL)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
乌
|
wolfSSL provides |
compilation of patched code
|
I think that can fixed by adding:
in libgearman/interface/universal.hpp? |
I recently applied a modified version of the patch to gearmand 1.1.15, and I will be testing it soon. Besides the
bits in libgearman/universal.cc and libgearman-server/plugins/protocol/gear/protocol.cc and util/instance.cc. I left those bits out of my version. |
What is disadvantage in using |
libgearman/worker.hpp is patched in 39c0269 in this way: void enable_ssl()
{
+ return;
if (getenv("GEARMAND_CA_CERTIFICATE"))
{
gearman_worker_add_options(_worker, GEARMAN_WORKER_SSL); Should be banished? |
@esabol, this branch is rebased against gearman master. Except removing of |
Yes. I didn't include this in my version. |
The change made me nervous since it's not in the existing code base. Also, I don't actually specify a private key in my gearmand SSL configuration, and I was worried that this change would require me to do so. |
That's what I'm here to do. 👍 I just confirmed that our two versions are identical except for the |
I have successfully tested this patched libgearman.so with hjr3's Gearman PHP extension + SSL patch. It works! |
@esabol, would you please create a PR from your code base? |
I can do that. It's the same as yours except for the |
It's easier to discuss these things inline with code, rather than in an issue. Just focuses the discussion. Open that PR and we can all reason about the changes. |
…-for-php Issue #63: Add set_ssl API to libgearman for PHP extension and other potential uses
now that #257 is in this should be closed, right? |
Right. Closing.... |
There's a patch to add SSL support to the the Gearman PHP library that's been languishing for over 2 years over at http://bugs.php.net/bug.php?id=67623. The reason for that is that it relies on some (relatively straightforward?) changes to libgearman. The libgearman patch can be found at http://bugs.launchpad.net/gearmand/+bug/1338861. The patch (to gearmand 1.1.12) needs to be rebased, obviously, and it looks like it could use a little more polish. I'm willing to take a crack at that. If anyone has any comments on the patch or changes you feel need to be made to the patch in order to get it accepted, I'd like to hear them. It would be really nice to get this committed here, so that some future release of the Gearman PHP library could support SSL connections.
The text was updated successfully, but these errors were encountered: