swoole-src: I get a SSL error swSSL_connection_error (ERRNO 1014)
Please answer these questions before submitting your issue. Thanks!
- What did you do? If possible, provide a simple script for reproducing the error.
- I get many errors which is shown below.
- It is shown error when sending an image data (about 8KB) to SSL connected client.
NOTICE swSSL_connection_error (ERRNO 1014): SSL connection#0[IP:Port] protocol error[127]
- I’m using Let’s encrypt certification file.
Short Script.
go(function () use ($packet, $channel, $synchronizer) {
...
$data = 'data:image/jpeg;base64,' . base64_encode($packet);
for ($i = 1, $chunks = str_split($data, $client->getChunkSize()), $loops = count($chunks); $i <= $loops; $i++) {
$client
->enableBuffer(false)
->enableChunk(false)
->write(
WebSocket::encodeMessage(
$client,
$chunks[$i - 1],
$i === 1
? WebSocket::OPCODE_MESSAGE
: WebSocket::OPCODE_CONTINUATION,
$i === $loops
)
);
}
}
...
-
$packet is an image data.
-
It is encoding text with WebSocket RFC.
Full code is here: https://github.com/memory-agape/magnolia-server/blob/master/src/magnolia/Client/Camera.php#L103
-
What did you expect to see? Don’t show errors.
-
What did you see instead?
-
What version of Swoole are you using (show your
php --ri swoole)?
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.4.2
Built => Jul 27 2019 15:27:18
coroutine => enabled
epoll => enabled
eventfd => enabled
signalfd => enabled
cpu_affinity => enabled
spinlock => enabled
rwlock => enabled
openssl => OpenSSL 1.0.2k-fips 26 Jan 2017
http2 => enabled
pcre => enabled
zlib => enabled
mutex_timedlock => enabled
pthread_barrier => enabled
futex => enabled
async_redis => enabled
- What is your machine environment used (including version of kernel & php & gcc) ? OS: CentOS 7 on Docker
PHP 7.3.7 (cli) (built: Jul 3 2019 11:30:22) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.7, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.3.7, Copyright (c) 1999-2018, by Zend Technologies
Details is here: https://github.com/memory-agape/magnolia-server/blob/master/infra/php/Dockerfile
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 25 (14 by maintainers)
Commits related to this issue
- Support SSL context options (#2717) — committed to swoole/swoole-src by twose 5 years ago
- Support SSL context options by alias, remove Swoole context support (#2717) — committed to swoole/swoole-src by twose 5 years ago
- Support SSL shutdown (#2717) — committed to swoole/swoole-src by twose 5 years ago
I will add some patches for SSL gradually