swoole-src: I get a SSL error swSSL_connection_error (ERRNO 1014)

Please answer these questions before submitting your issue. Thanks!

  1. 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

  1. What did you expect to see? Don’t show errors.

  2. What did you see instead?

  3. 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
  1. 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

Most upvoted comments

I will add some patches for SSL gradually