|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [2014-07-15 12:57 UTC] chjgcn at gmail dot com
 Description:
------------
The Gearman JobServer can start up using SSL, but libgearman does not support it well, and this extenssion does not support it. Now I have done some change with the libgearman code , and have posted a patch file at
    https://bugs.launchpad.net/gearmand/+bug/1338861
Then I modify this extenssion code, and post the patch file here. I have tested that with this patch, PHP code can set SSL by
    // Client:
    $gearman_client = new GearmanClient();
    $gearman_client->setSSL(true, "ca_file_path", "certificate_path", "key_file_path");
    $gearman_client->addServer();
    // Worker:
    $gearman_worker = new GearmanWorker();
    $gearman_worker->setSSL(true, "ca_file_path", "certificate_path", "key_file_path");
    $gearman_worker->addServer();
and communicate with JobServer using SSL now.
Patchesgearman-ssl.patch (last revision 2014-07-17 07:24 UTC by chjgcn at gmail dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 23:00:01 2025 UTC | 
If I call addServer before setSSL in PHP code, it will raise an exception: 0 : Failed to set exception option and there is a error message in server side: SSL routines:SSL23_GET_CLIENT_HELLO:unknown protocol This is caused by calling gearman_client_set_server_option() exactly after gearman_client_add_server(), and gearman_client_set_server_option() will make a real connection to server while SSL has not been set. The way to fix this is removing gearman_client_set_server_option() after gearman_client_add_server() and gearman_worker_set_server_option() after gearman_worker_add_server() .