Amphp Artax 错误
Amphp Artax bug
我使用了以下非常基本的示例 amphp/artax
$URL 可以是任何 url 例如http://www.yahoo.com
$promises[$URI] = Amp\call(function () use ($client, $URI) {
// "yield" inside a coroutine awaits the resolution of the promise
// returned from Client::request(). The generator is then continued.
$response = yield $client->request($URI);
// Same for the body here. Yielding an Amp\ByteStream\Message
// buffers the entire message.
$body = yield $response->getStatus();
return $body;
});
$responses = Amp\Promise\wait(Amp\Promise\all($promises));
并出现以下错误
Fatal error: Uncaught Amp\Socket\CryptoException: Crypto negotiation failed: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type in /var/www/html/vendor/amphp/socket/src/Internal/functions.php:118
Stack trace:
#0 /var/www/html/vendor/amphp/amp/lib/Loop/NativeDriver.php(172): Amp\Socket\Internal\{closure}('am', Resource id #293, Object(Amp\Deferred))
#1 /var/www/html/vendor/amphp/amp/lib/Loop/NativeDriver.php(68): Amp\Loop\NativeDriver->selectStreams(Array, Array, 4.782)
#2 /var/www/html/vendor/amphp/amp/lib/Loop/Driver.php(130): Amp\Loop\NativeDriver->dispatch(true)
#3 /var/www/html/vendor/amphp/amp/lib/Loop/Driver.php(70): Amp\Loop\Driver->tick()
#4 /var/www/html/vendor/amphp/amp/lib/Loop.php(76): Amp\Loop\Driver->run()
#5 /var/www/html/vendor/amphp/amp/lib/functions.php(158): Amp\Loop::run(Object(Closure))
#6 /var/www/html/parseradvance.php(77): Amp\Promise\wait(Object(Amp\Internal\PrivatePromise))
#7 {main}
t in /var/www/html/vendor/amphp/socket/src/Internal/functions.php on line 118
任何人都可以帮我解决我已经设置的问题 cainfo=curl.pem
提前致谢
这是由配置了弱密码的服务器引起的,Artax 默认拒绝这种密码。通过在创建和设置 withSecurityLevel(1)
, which defaults to 2
. See also https://github.com/amphp/artax/issues/174.
时将自定义 ClientTlsContext
实例传递给客户端,可以允许较弱的密码
可能是因为您使用 http:
而不是 https:
。
我使用了以下非常基本的示例 amphp/artax
$URL 可以是任何 url 例如http://www.yahoo.com
$promises[$URI] = Amp\call(function () use ($client, $URI) {
// "yield" inside a coroutine awaits the resolution of the promise
// returned from Client::request(). The generator is then continued.
$response = yield $client->request($URI);
// Same for the body here. Yielding an Amp\ByteStream\Message
// buffers the entire message.
$body = yield $response->getStatus();
return $body;
});
$responses = Amp\Promise\wait(Amp\Promise\all($promises));
并出现以下错误
Fatal error: Uncaught Amp\Socket\CryptoException: Crypto negotiation failed: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages:
error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type in /var/www/html/vendor/amphp/socket/src/Internal/functions.php:118
Stack trace:
#0 /var/www/html/vendor/amphp/amp/lib/Loop/NativeDriver.php(172): Amp\Socket\Internal\{closure}('am', Resource id #293, Object(Amp\Deferred))
#1 /var/www/html/vendor/amphp/amp/lib/Loop/NativeDriver.php(68): Amp\Loop\NativeDriver->selectStreams(Array, Array, 4.782)
#2 /var/www/html/vendor/amphp/amp/lib/Loop/Driver.php(130): Amp\Loop\NativeDriver->dispatch(true)
#3 /var/www/html/vendor/amphp/amp/lib/Loop/Driver.php(70): Amp\Loop\Driver->tick()
#4 /var/www/html/vendor/amphp/amp/lib/Loop.php(76): Amp\Loop\Driver->run()
#5 /var/www/html/vendor/amphp/amp/lib/functions.php(158): Amp\Loop::run(Object(Closure))
#6 /var/www/html/parseradvance.php(77): Amp\Promise\wait(Object(Amp\Internal\PrivatePromise))
#7 {main}
t in /var/www/html/vendor/amphp/socket/src/Internal/functions.php on line 118
任何人都可以帮我解决我已经设置的问题 cainfo=curl.pem
提前致谢
这是由配置了弱密码的服务器引起的,Artax 默认拒绝这种密码。通过在创建和设置 withSecurityLevel(1)
, which defaults to 2
. See also https://github.com/amphp/artax/issues/174.
ClientTlsContext
实例传递给客户端,可以允许较弱的密码
可能是因为您使用 http:
而不是 https:
。