From f95af89939fb8b66ab5e4e2633d3e74a833664ee Mon Sep 17 00:00:00 2001 From: dpeca Date: Sun, 31 Jan 2016 03:47:30 +0100 Subject: [PATCH 1/2] Update vesta.php New version of roundcube 'password' plugin is expecting class instead of function. --- install/debian/8/roundcube/vesta.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/debian/8/roundcube/vesta.php b/install/debian/8/roundcube/vesta.php index 8fb202a4..db31d89a 100644 --- a/install/debian/8/roundcube/vesta.php +++ b/install/debian/8/roundcube/vesta.php @@ -6,8 +6,8 @@ * @version 1.0 * @author Serghey Rodin */ - - function password_save($curpass, $passwd) +class rcube_vesta_password { + function save($curpass, $passwd) { $rcmail = rcmail::get_instance(); $vesta_host = $rcmail->config->get('password_vesta_host'); @@ -60,3 +60,4 @@ } } +} From 6fbc433a52002a238606290e5745ae8905c0d339 Mon Sep 17 00:00:00 2001 From: dpeca Date: Sun, 14 Feb 2016 17:51:16 +0100 Subject: [PATCH 2/2] SSL fix for roundcube/plugins/password/drivers/vesta.php Fix that will allow vesta driver to comunicate with VestaCP even there are self signed SSL cert. Previously fsockopen failed to connect on self-signed SSL cert. --- install/debian/8/roundcube/vesta.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install/debian/8/roundcube/vesta.php b/install/debian/8/roundcube/vesta.php index db31d89a..3261f656 100644 --- a/install/debian/8/roundcube/vesta.php +++ b/install/debian/8/roundcube/vesta.php @@ -40,7 +40,16 @@ class rcube_vesta_password { $send .= PHP_EOL; $send .= $postdata . PHP_EOL . PHP_EOL; - $fp = fsockopen('ssl://' . $vesta_host, $vesta_port); + //$fp = fsockopen('ssl://' . $vesta_host, $vesta_port); + $errno = ""; + $errstr = ""; + $context = stream_context_create(); + + $result = stream_context_set_option($context, 'ssl', 'verify_peer', false); + $result = stream_context_set_option($context, 'ssl', 'verify_host', false); + $result = stream_context_set_option($context, 'ssl', 'allow_self_signed', true); + + $fp = stream_socket_client('ssl://' . $vesta_host . ':'.$vesta_port, $errno, $errstr, 60, STREAM_CLIENT_CONNECT, $context); fputs($fp, $send); $result = fread($fp, 2048); fclose($fp);