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: Allow PSV mode on IPv6 connections if a proxy is being used #2432

Closed
wants to merge 1 commit into from

Conversation

lclarkmichalek
Copy link
Contributor

@lclarkmichalek lclarkmichalek commented Mar 28, 2018

In the situation of a client connecting to an FTP server using an
IPv6 tunnel proxy, the connection info will indicate that the connection
is IPv6. However, because the server behind the proxy is IPv4, it is
permissible to attempt PSV mode. In the case of the FTP server being
IPv4 only, EPSV will always fail, and with the current logic curl will
be unable to connect to the server, as the IPv6 fwdproxy causes curl to
think that EPSV is impossible.

I've tested this privately, using a CONNECT IPv6 proxy to connect to an IPv4 host. I'm not sure if there is a better way to test if the connection is using a proxy (I stole this conditional from the control_address function below this one).

In the situation of a client connecting to an FTP server using an
IPv6 tunnel proxy, the connection info will indicate that the connection
is IPv6. However, because the server behing the proxy is IPv4, it is
permissable to attempt PSV mode. In the case of the FTP server being
IPv4 only, EPSV will always fail, and with the current logic curl will
be unable to connect to the server, as the IPv6 fwdproxy causes curl to
think that EPSV is impossible.
@lclarkmichalek lclarkmichalek changed the title Allow PSV mode on IPv6 connections if a proxy is being used ftp: Allow PSV mode on IPv6 connections if a proxy is being used Mar 28, 2018
Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good and simple enough to me. Thanks!

@bagder
Copy link
Member

bagder commented Apr 6, 2018

Thanks!

@bagder bagder closed this in 5f3938b Apr 6, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

2 participants