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

FTP in passive mode #275

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Nicronics
Copy link

I don't know if someone else got this issue, but without passive mode, acme-challenge by FTP needs many retries to work. Whereas, when passive mode is activated, all works perfectly!

@Nicronics Nicronics changed the title In my case, FTP works better in passive mode FTP in passive mode Mar 30, 2017
@tlhackque
Copy link
Contributor

Passive mode is required to get through most firewalls, so this needs a fix.

Unfortunately, just adding to the ftp command "-p" won't work. ftp on my linux system doesn't have that option. You need to use the 'passive' subcommand. Windows has a registry key, but last I knew, the command line client doesn't support passive mode. Some third-party tools do (!).

If you want to stick with the ftp command, I'd suggest a FTP_OPTIONS variable and an FTP_COMMANDS variable. Then make the code look something like:

     ftp -n ${FTP_OPTIONS}<<- _EOF
			open $ftphost
			user $ftpuser $ftppass
                        ${FTP_COMMANDS}
			cd $ftpdirn
			lcd $fromdir
			put $fromfile
			_EOF

(Clients I can think of won't mind the blank line if FTP_COMMANDS is blank.)

I don't have the right environment to test this, but it seems like the right approach.

But there is a better approach: getssl relies on curl. And curl supports ftp. So why not switch to using curl for ftp transfers? Just use an ftp://URL for the remote.

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

Successfully merging this pull request may close these issues.

2 participants