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

Adds SSL/TLS toggle to FTP connection #4318

Closed
wants to merge 2 commits into from

Conversation

bdelcamp
Copy link

This adds basic yes/no to the FTP connection enabling basic ftps functionality. An underlying issue is that promise-ftp uses an out of date version of @icetee/ftp which has a bug which causes ftps connect to fail. I have a pull request open here realtymaps/promise-ftp#47 to update that library. Updating manually on the local node_modules works, and all tests still pass.

@CLAassistant
Copy link

CLAassistant commented Oct 11, 2022

CLA assistant check
All committers have signed the CLA.

@n8n-assistant n8n-assistant bot added community Authored by a community member node/improvement New feature or request labels Oct 11, 2022
@Joffcom
Copy link
Member

Joffcom commented Oct 12, 2022

Hey @bdelcamp,

Thanks for the PR, This is something that I have felt we have been missing for a while. I guess we will need to wait for the other PR to be merged first.

There are a couple of tweaks for this one as well, There is the toggle for SSL/TLS but it is just set to true for the credential test instead of using the credential value. It would also be worth adding a toggle to ignore invalid / self signed certificates as well and setting secureOptions to include rejectUnauthorized.

I do very much like what you have started to do here though, Nice work 🙌🏻

... quick edit: I wonder if it would be worth changing the toggle to a dropdown so we can have Plain, Implicit and Explicit as options.

@bdelcamp
Copy link
Author

bdelcamp commented Oct 12, 2022 via email

@bdelcamp
Copy link
Author

Hey @bdelcamp,

Thanks for the PR, This is something that I have felt we have been missing for a while. I guess we will need to wait for the other PR to be merged first.

There are a couple of tweaks for this one as well, There is the toggle for SSL/TLS but it is just set to true for the credential test instead of using the credential value. It would also be worth adding a toggle to ignore invalid / self signed certificates as well and setting secureOptions to include rejectUnauthorized.

I do very much like what you have started to do here though, Nice work 🙌🏻

... quick edit: I wonder if it would be worth changing the toggle to a dropdown so we can have Plain, Implicit and Explicit as options.

Ha, not sure when you edited that, but I committed that change yesterday morning:)

@j2bd
Copy link

j2bd commented Nov 22, 2022

Hi guys,
Thanks @bdelcamp @Joffcom for your great work.
IT could be great to have SSL/TLS to FTP node soon...

@bdelcamp
Copy link
Author

It doesn't seem like promise-ftp will be updated, not sure what other alternative there would be other than to fork it and include it directly...

@flosky
Copy link

flosky commented Dec 2, 2022

@bdelcamp please let me know if you plan to create a fork. We also have an interest in upgrading the dependencies to the latest version to remove some deprecation warnings and possible vulnerabilities.

@IceBreaker8
Copy link

@bdelcamp I have clone the fix you made, npm install, npm run build and npm run start, but the problem isn't fixed for me.
We are trying to establish an FTP connection to an outside server via n8n.
When we do so, we get an SSL/TLS connection error.

@bdelcamp
Copy link
Author

bdelcamp commented Dec 12, 2022

@bdelcamp I have clone the fix you made, npm install, npm run build and npm run start, but the problem isn't fixed for me. We are trying to establish an FTP connection to an outside server via n8n. When we do so, we get an SSL/TLS connection error.

@IceBreaker8 Did you see that it also requires a patched version of realtymaps/promise-ftp ?

@bdelcamp
Copy link
Author

@bdelcamp please let me know if you plan to create a fork. We also have an interest in upgrading the dependencies to the latest version to remove some deprecation warnings and possible vulnerabilities.

@flosky I don't know if I can devote the time to maintaining a fork of that library, I would propose that the n8n project create the fork, that way anyone can directly contribute to it, and it can be directly included in the n8n builds.

@IceBreaker8
Copy link

@bdelcamp I did upgrade that dependency manually... Do you have a working github project repo that works that I can clone?

@Joffcom
Copy link
Member

Joffcom commented Dec 14, 2022

@bdelcamp my worry there is I don't know if we would have the time to maintain a fork of the library either.

I have some other thoughts though which I will look into early next year.

@bdelcamp
Copy link
Author

@Joffcom To be fair, it's really not maintained at present either, but if the project forks it, then any contributor can create pull requests against it to keep it relevant to the project itself.

@morphar
Copy link

morphar commented Dec 21, 2022

Could this be fixed with overrides ?

@morphar
Copy link

morphar commented Dec 21, 2022

I'm thinking something like this in n8n's package.json:

{
  ...
  "overrides": {
    "@icetee/ftp": "^1.0.8"
  }
}

@morphar
Copy link

morphar commented Dec 21, 2022

I don't know exactly what to expect with regards to errors, but I have set up a dev env and tried adding the above overrides to package.json in nodes-base and the changes made in this pull request.
So far I've succeeded in listing files and downloading a file from an FTPS server.

Just to be on the safe side: I am aware of the difference between SFTP and FTPS ;-)
And I am 100% sure that I am now talking to an FTPS server that I could not connect with, before these updates.

@bdelcamp
Copy link
Author

@morphar Good idea, that didn't even occur to me... This seems like the most maintainable solution at the moment until the upstream maintainer wants to update their dependencies.

morphar added a commit to morphar/n8n that referenced this pull request Dec 22, 2022
@morphar morphar mentioned this pull request Dec 22, 2022
@dncpax
Copy link

dncpax commented Apr 14, 2023

hey there. is this going to happen? @Joffcom is this still on your radar?

@Joffcom
Copy link
Member

Joffcom commented Apr 14, 2023

Hey @dncpax,

This is on my radar but it is something that I think needs to be done as part of an overhaul so we can make sure we support both Implicit and Explicit FTPS and some of the other options. The best way I can think of to do this would be to change to a different package which won't be a quick job.

@umbearto
Copy link

Hello, any update on this?

@Nionor
Copy link

Nionor commented Apr 10, 2024

Would also be interested in this.
I'm self-hosting this in docker, would the fixes from @bdelcamp and @morphar be something that could be changed on a running container as a temporary fix or does it require a full rebuild from source?

@Joffcom
Copy link
Member

Joffcom commented Jul 8, 2024

Hey @bdelcamp,

It looks like the PR has still not been merged on the other end, What I have done internally is created a dev ticket to move to a different package so that we can implement this properly in the future.

Because of this planned change it does sadly mean that I will need to close this PR as it will no longer be relevant as such, Thanks for sticking with us on this one.

I don't have a timeline yet but I want to make sure we get this done this year.

@Joffcom Joffcom closed this Jul 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Authored by a community member node/improvement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants