phpcms转到https后无法注册问题的解决

来源:互联网 发布:工程预算软件大全 编辑:程序博客网 时间:2024/05/17 07:20

phpcms/modules/member/classes/client.class.php
中361行增加

$port = !empty($matches['port']) ? $matches['port'] : ( strtolower($matches['scheme'])=='https' ? 443 : 80 );

中386行

$fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);

替换为

$contextOptions = array(    'ssl' => array(        'verify_peer' => false,        'verify_peer_name' => false    ));//如果有签名的证书//$contextOptions = array(//    'ssl' => array(//        'verify_peer' => true, //        'cafile' => '/path/to/cacert.pem',//        //'CN_match' => 'indexroot.net', // 匹配域名//        'ciphers' => 'HIGH:!SSLv2:!SSLv3',//        'disable_compression' => true,//    )//);$context = stream_context_create($contextOptions);$fp = stream_socket_client("ssl://{$host}:{$port}", $errno, $errstr, $timeout, STREAM_CLIENT_CONNECT, $context);

下载 此文件

阅读全文
0 0