Ratchet WSS Handshake Error Apache2 XAMPP

13 Views Asked by At

I know the method I'm using is probably not advised but I think I'm missing a step. Im trying to establissh a secure web connection with ratchet server on apacche2 & XAMPP. I've setup proxypass.

Here's the code:

<?php
use Config\Chat;

use Ratchet\Server\IoServer;
use Ratchet\Http\HttpServer;
use Ratchet\WebSocket\WsServer;
use Ratchet\MessageComponentInterface;
use Ratchet\ConnectionInterface;

use React\EventLoop\Factory;
use React\Socket\SecureServer;
use React\Socket\Server;


require dirname(__DIR__) . '/src/php/ratchet/vendor/autoload.php';
require dirname(__DIR__) . '/src/php/reactphp/vendor/autoload.php';
require dirname(__DIR__) . '/src/php/chat/chat.php';

$sslCertPath = '/Applications/XAMPP/xamppfiles/etc/ssl.crt/server.crt';
$sslKeyPath = '/Applications/XAMPP/xamppfiles/etc/ssl.key';
// // $wssPort = 1112;

$app = new HttpServer(
    new WsServer(
        new Chat()
    )
);

$loop = Factory::create();
$webSock = new Server('0.0.0.0:8080', $loop);

$webSock = new SecureServer($webSock, $loop, [
    'local_cert' => '../etc/ssl.crt/server.crt', 
    'local_pk'=> '../etc/ssl.key', 
    'allow_self_signed' => true, 
    'verify_peer' => false
]);

$server = new IoServer($app, $webSock, $loop);
$server->run();

?>

i get

[Tue Mar 12 18:15:11.162723 2024] [proxy:error] [pid 10399] (20014)Internal error (specific information not available): [client 127.0.0.1:54596] AH01084: pass request body failed to 0.0.0.0:8080 (0.0.0.0)
[Tue Mar 12 18:15:11.162951 2024] [proxy:error] [pid 10399] [client 127.0.0.1:54596] AH00898: Error during SSL Handshake with remote server returned by /wss/
[Tue Mar 12 18:15:11.162961 2024] [proxy_http:error] [pid 10399] [client 127.0.0.1:54596] AH01097: pass request body failed to 0.0.0.0:8080 (0.0.0.0) from 127.0.0.1 ()

My question is, is it still possible to use this approach? Can I use nginx if so how?

0

There are 0 best solutions below