本文整理汇总了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
}