mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 18:49:21 -07:00
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.
This commit is contained in:
parent
f95af89939
commit
6fbc433a52
1 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue