stuicey / SSHy

HTML5 SSH Web Client
MIT License
543 stars 83 forks source link

SSL Error #25

Open spudalicious opened 5 years ago

spudalicious commented 5 years ago

I'm really looking forward to using this, however, I am running into one issue. I have installed SSHy by git into the folder I wish to start from nerd.mydomain.com I installed wsproxy using sudo (only way it seems to work for my on my install of ubuntu)

git submodule update --init --recursive sudo npm i -g wsproxy/ sudo wsproxy

I run the command sudo wsproxy -s -k /etc/letsencrypt/live/mydomain.com-0001/privkey.pem -c /etc/letsencrypt/live/mydomain.com-0001/privkey.pem

I get the following error in the terminal

      c.context.setCert(cert);
                ^

Error: error:0906D06C:PEM routines:PEM_read_bio:no start line
    at Object.createSecureContext (_tls_common.js:113:17)
    at Server (_tls_wrap.js:870:27)
    at new Server (https.js:62:14)
    at Object.createServer (https.js:85:10)
    at new Init (/var/www/html/nerd/wsproxy/src/server.js:28:23)
    at Init (/var/www/html/nerd/wsproxy/src/main.js:29:15)
    at Object.<anonymous> (/var/www/html/nerd/wsproxy/index.js:37:1)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)

I sincerely appreciate any assistance. Cheers!

stuicey commented 5 years ago

Might be a copy paste mistake while making this ticket but looks like you're trying to use a private key as a certificate? If you were this error makes sense as the files have different structures.

sudo wsproxy -s -k /etc/letsencrypt/live/mydomain.com-0001/privkey.pem -c /etc/letsencrypt/live/mydomain.com-0001/privkey.pem

Could you make sure you're using a certificate chain for the -c argument?

spudalicious commented 5 years ago

Thank you so much for a quick response. yep, I was an idiot. Using fullchain.pem, wsproxy starts with no erorrs but, still not loading at nerd.mydomain.com I get this error in chrome console:

(index):223 WebSocket connection to 'wss://localhost:6001/mydomain.com:22' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED

SSH server is running and can be accessed with Putty. I'm certain that I am yet again missing something painfully obvious. thanks so much for your help.

stuicey commented 5 years ago

Apologies missed this notification...

Whats the output you get in the wsproxy window when the connection fails? I'd guess its a certificate related issue, either something with the chain or the browser wanting it to be issued to the same domain?