Sending files over ssh connection

Hi,

I’m new to Crystal, and so far mostly so good. However I can’t figure out how to send commands to another host via ssh. The current goal is a very simple static site generator for small internet protocols, that can upload files over ssh directly to specified servers…

Actually I’m also struggling with learning about secure connections in general – the ‘client’ example in the OpenSSL docs always gives me this error when I try to connect to a known host on my LAN:

“Unhandled exception: SSL_connect: error:1408F10B:SSL routines:ssl3_get_record:wrong version number (OpenSSL::SSL::Error)”

I’m on MX Linux, roughly Debian 11 if that helps.

Can anyone please point me towards some information on what I might have missed/misread/misunderstood, or point me the way of a useful article on Crystal and SSL/SSH?

Thanks!

The error message indicates that you might not be talking to an SSL endpoint.
Can you perhaps share some exact steps to reproduce this situation?

For SSH, you might want to look into this shard: GitHub - spider-gazelle/ssh2.cr: libssh2 binding for Crystal language

You’re right, it was an endpoint issue – I had tried to connect to the wrong subdomain.

The ssh2.cr shard looks really good. I was connected to a local and a remote server in no time flat :slight_smile:

Thanks!