(PECL ssh2 >= 0.9.0)
ssh2_methods_negotiated — 返回协商的方法列表
示例 #1 确定协商了哪些方法
<?php
$connection = ssh2_connect('shell.example.com', 22);
$methods = ssh2_methods_negotiated($connection);
echo "加密密钥使用以下方式协商: {$methods['kex']}\n";
echo "服务器使用 {$methods['hostkey']} 进行标识,并使用 ";
echo "指纹: " . ssh2_fingerprint($connection) . "\n";
echo "客户端到服务器数据包将使用以下方法:\n";
echo "\t加密: {$methods['client_to_server']['crypt']}\n";
echo "\t压缩: {$methods['client_to_server']['comp']}\n";
echo "\tMAC: {$methods['client_to_server']['mac']}\n";
echo "服务器到客户端数据包将使用以下方法:\n";
echo "\t加密: {$methods['server_to_client']['crypt']}\n";
echo "\t压缩: {$methods['server_to_client']['comp']}\n";
echo "\tMAC: {$methods['server_to_client']['mac']}\n";
?>