Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:0A00009C:SSL routines::http request #286

Open
binemmanuel opened this issue May 28, 2023 · 0 comments

Comments

@binemmanuel
Copy link
Contributor

binemmanuel commented May 28, 2023

I need to be able to access the server without SSL, when I try I get the SSL handshake error;

SSL handshake error: stream_socket_enable_crypto(): SSL operation failed with code 1. OpenSSL Error messages: error:0A00009C:SSL routines::http request

It was working fine previously or maybe I'm missing what I did to make it work fine previous before the server was destroyed and now recreating even with the proxy isn't working fine.

domain.com-le-ssl.conf

RewriteEngine on
RewriteCond %{REQUEST_URI}  ^/socket.io            [NC]
RewriteCond %{QUERY_STRING} transport=websocket    [NC]
RewriteCond %{HTTP:Upgrade} websocket              [NC]
RewriteCond %{HTTP:Connection} upgrade             [NC]
RewriteRule /(.*)           ws://domain.com:8181/$1 [P,L]

ProxyRequests Off
ProxyPass "/socket.io/" "http://domain.com:8181/socket.io/"
ProxyPassReverse "/socket.io/" "http://domain.com:8181/socket.io/"

server.php

$context = [
    'ssl' => [
        'local_cert'  => '/etc/letsencrypt/live/domain.come/fullchain.pem',
        'local_pk'    => '/etc/letsencrypt/live/domain.com/privkey.pem',
        'allow_self_signed' => true,
        'verify_peer' => false,
        'verify_peer_name' => false,
    ]
];

$io = new SocketIO(8181, $context);

if I don't pass the "$context" when initialising SocketIO object, then the client app can connect successfully, but I wish it could be over SSL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant