當前位置: 首頁>>代碼示例>>PHP>>正文


PHP squidbee::ssl_bump_line方法代碼示例

本文整理匯總了PHP中squidbee::ssl_bump_line方法的典型用法代碼示例。如果您正苦於以下問題:PHP squidbee::ssl_bump_line方法的具體用法?PHP squidbee::ssl_bump_line怎麽用?PHP squidbee::ssl_bump_line使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在squidbee的用法示例。


在下文中一共展示了squidbee::ssl_bump_line方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tests_port

function tests_port($port_id)
{
    $unix = new unix();
    $squid = new squidbee();
    $q = new mysql_squid_builder();
    $ligne = @mysql_fetch_array($q->QUERY_SQL("SELECT * FROM proxy_ports WHERE ID={$port_id}"));
    $ssl_bump_line = $squid->ssl_bump_line($ligne["sslcertificate"]);
    $randport = rand(63500, 65535);
    build_progress("{testing_ssl_certificate} ID:{$port_id} {$ligne["sslcertificate"]}", 15);
    $t = time();
    $pid_filename = "/var/run/squid/{$t}.pid";
    $cache_log = "/var/log/squid/cache.{$t}.log";
    $f[] = "coredump_dir\t/var/squid/cache";
    $f[] = "cache_log\t/var/log/squid/cache.log";
    $f[] = "pid_filename\t/var/run/squid/squid.pid";
    $f[] = "cache_effective_user squid";
    $f[] = "http_port 127.0.0.1:{$randport} {$ssl_bump_line}";
    echo " ***********************************************************************\n";
    echo "Using HTTPS port {$ssl_bump_line} Certificate {$ligne["sslcertificate"]}\n";
    echo " ***********************************************************************\n";
    $f[] = "";
    $tmpfile = $unix->FILE_TEMP();
    $squidbin = $unix->LOCATE_SQUID_BIN();
    build_progress("{testing_ssl_certificate} {$ligne["sslcertificate"]}", 20);
    echo "Conf  : {$tmpfile}\n";
    echo "Binary: {$squidbin}\n";
    @file_put_contents($tmpfile, @implode("\n", $f));
    exec("{$squidbin} -f {$tmpfile} -k check 2>&1", $results);
    @unlink($tmpfile);
    while (list($num, $line) = each($results)) {
        echo "Check  : {$line}\n";
        if (preg_match("#FATAL: No valid signing SSL#", $line)) {
            build_progress("{testing_ssl_certificate_failed} {$ligne["sslcertificate"]}", 110);
            $sql = "UPDATE proxy_ports SET sslcertificate='' WHERE ID='{$port_id}'";
            $q->QUERY_SQL($sql);
            return;
        }
    }
    build_progress("{testing_ssl_certificate} {success}", 100);
    // FATAL: No valid signing SSL certificate
}
開發者ID:BillTheBest,項目名稱:1.6.x,代碼行數:41,代碼來源:exec.squid.testssslports.php


注:本文中的squidbee::ssl_bump_line方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。