Rapsssito / react-native-tcp-socket

React Native TCP socket API for Android, iOS & macOS with SSL/TLS support.
MIT License
315 stars 80 forks source link

Connecting to an FTP server with TLS enabled results in Handshake failed exception #73

Closed bencun closed 4 years ago

bencun commented 4 years ago

Description

I'm successfully connecting to my FTP server (Filezilla) over port 2121 in plain text mode and I'm greeted with 220 Welcome. However, when using the following options:

tls: true,
tlsCheckValidity: false,
tlsCert: null, // or undefined, same thing

...I get the Handshake failed exception.

Steps to reproduce

Try connecting to a FTP server with TLS enabled

Current behavior

Handshake failed exception.

Expected behavior

Successful socket connection.

Relevant information

OS Windows
react-native 0.61
react-native-tcp-socket 4.2.0

Furthermore, on a completely unrelated note - is there somewhere to be found a list of valid events that we can listen to? Thanks.

Rapsssito commented 4 years ago

@bencun, sorry for your issue and thanks for the feedback. Are you using Android or iOS?

Is there somewhere to be found a list of valid events that we can listen to?

You can take a look at the server and client examples shown in the documentation. I will update the API section with all the valid events to make it clearer.

bencun commented 4 years ago

@Rapsssito the app is running on Android. I'll be spinning up another FTP server with a different certificate and TLS today and try spinning it up and testing. I did everything as described in the examples but unfortunately that didn't help.

bencun commented 4 years ago

@Rapsssito I've tried connecting to a completely different FTP server that uses proper SSL security on port 22 and I got the same Handshake failed exception.

Are you familiar with whether connecting over TCP socket to a secure FTP server is possible at all?

Rapsssito commented 4 years ago

@bencun, sorry but I am not familiar with raw TCP connections to FTP, but I will try my best to help. Have you check if it works without SSL?

bencun commented 4 years ago

Yes! It works without SSL no issues there!

Rapsssito commented 4 years ago

@bencun, it might sound like a dumb question, but have you tested the SSL FTP with other software like Filezilla or something like that?

bencun commented 4 years ago

Yes I did, that's exactly what I described in this comment: https://github.com/Rapsssito/react-native-tcp-socket/issues/73#issuecomment-670450786 I didn't mention it was Filezilla but yes - and it's not working.

It seems to me after some research that this issue might be unrelated to how sockets work and FTP might actually have it's own SSL implementation so I'll be closing this for now, if I come up with something I'll make sure to leave a comment here. Thank you!