Comments (6)
Perhaps it has to do with the site behind cloudflare and on http2?
Edit:
I tried to comment out setDefer in the Request file and that seems to work, why?
/** Set defer and timeout */
$this->client->setDefer(); //总是延迟回包以使用timeout定时器特性
from saber.
@twose Can I send you a private message to include the https link that I'm trying to access together with the complete code I'm using to test so you can take a look for me please?
For example, in your document, you use httpbin, if I try it like this
$responses = \Swlib\SaberGM::requests([
['uri' => 'https://httpbin.org'],
]);
I will get
[2018-12-07 09:15:40 @7111.0] WARNING swSSL_connect: SSL_connect(fd=5) failed. Error: (null)[1|0].
PHP Fatal error: Uncaught Swlib\Http\Exception\ConnectException: HTTP -1 Unknown: Connect timeout! the server is not listening on the port or the network is missing! in /myfolder/workers/swoole-workers/vendor/swlib/saber/src/Request.php:641
Stack trace:
#0 /myfolder/workers/swoole-workers/vendor/swlib/saber/src/RequestQueue.php(117): Swlib\Saber\Request->recv()
#1 /myfolder/workers/swoole-workers/vendor/swlib/saber/src/Saber.php(278): Swlib\Saber\RequestQueue->recv()
#2 /myfolder/workers/swoole-workers/vendor/swlib/saber/src/SaberGM.php(90): Swlib\Saber->requests(Array, Array)
#3 /myfolder/workers/swoole-workers/monitor.php(51): Swlib\SaberGM::requests(Array)
#4 {main}
thrown in /myfolder/workers/swoole-workers/vendor/swlib/saber/src/Request.php on line 641
php --ri swoole
swoole support => enabled
Version => 4.2.10-alpha
Author => Swoole Group[email: [email protected]]
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
sockets => enabled
openssl => OpenSSL 1.1.1 11 Sep 2018
http2 => 1.36.0-DEV
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabledDirective => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608
from saber.
if you comment out setDefer in the Request file, it should never work.
it's so strange, look like openssl library error, I will try to find the solution.
from saber.
It's a design bug, we must use this way to make it work, I will fix it soon and release a new version (Saber). (maybe it will also be an enhancement in the swoole kernel).
echo SaberGM::psr([
'uri' => 'https://httpbin.org/get',
'ssl_verify_peer' => true,
'ssl_host_name' => 'httpbin.org'
])->withCAFile()->exec()->recv();
from saber.
most of the https servers need not use this way.
from saber.
Thanks @twose, I noticed that some servers dont need that as well? For my case I know my server is using the cert from letsencrypt, and then the DNS is done by cloudflare. Is this combination the cause of the issue?
Edit: I can verify that you suggested change does work, thank you alot.
from saber.
Related Issues (20)
- WARNING swSSL_connect: SSL_connect(fd=4) failed. Error: error:1414D172:SSL routines:tls12_check_peer_sigalg:wrong signature type[1|370]
- 模拟登陆没有返回302状态
- 怎么获取全部响应报文? HOT 1
- 关于Http客户端download时请求头Range
- Connect timeout! the server is not listening on the port or the network is missing! HOT 4
- Cookie parseHeader方法解析cookie需要增加容错 HOT 1
- JA3指纹反爬破解,需要开放ssl_ciphers参数配置 HOT 3
- 相同的response header会覆盖 HOT 1
- 请问 WebSocket 支持 proxy 吗?
- SaberGM::download中文名文件下载失败 HOT 1
- You can't enqueue a waiting request when using the max concurrency control!
- 如何禁止url自动转码? HOT 2
- 获取请求内容乱码 HOT 3
- 报错:Call to a member function push() on null HOT 1
- 连接wss协议时,报了一个很奇怪的错Websocket upgrade failed by [Connection timed out] HOT 1
- Warning "Deprecated: Implicit conversion from float to int loses precision"
- HTTP -1 Unknown: Connect timeout! the server is not listening on the port or the network is missing HOT 1
- 请教一下关于并发请求的问题.
- saber对url中的","的处理与其他http客户端有不一样的地方
- ssl_crypto_method
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from saber.