首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Amphp Artax错误

Amphp Artax错误
EN

Stack Overflow用户
提问于 2018-09-05 18:21:29
回答 2查看 283关注 0票数 0

我使用了以下非常基本的amphp/artax示例

$URL可以是任何url,例如http://www.yahoo.com

代码语言:javascript
复制
$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));

并得到以下错误

代码语言:javascript
复制
    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的问题吗

提前感谢

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-09-15 02:04:04

这是由配置了弱密码的服务器造成的,默认情况下Artax会拒绝该服务器。通过在创建时将自定义ClientTlsContext实例传递给客户端并设置withSecurityLevel(1) (默认为2 ),可以允许使用较弱的密码。另请参见https://github.com/amphp/artax/issues/174

票数 0
EN

Stack Overflow用户

发布于 2019-05-03 22:32:12

也许这是因为您使用的是http:而不是https:

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/52182784

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档