File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,6 +276,22 @@ FTP objects
276276 prints the line to :data: `sys.stdout `.
277277
278278
279+ .. attribute :: FTP.prefer_epsv
280+
281+ A :class: `bool ` that controls whether :meth: `makepasv ` tries the EPSV
282+ command (RFC 2428) before falling back to PASV on IPv4 connections.
283+ Defaults to ``True ``.
284+
285+ EPSV responses contain only a port number and no IP address, making them
286+ transparent to firewall FTP Application Layer Gateways (ALGs) that
287+ commonly intercept and mangle PASV responses. If the server does not
288+ support EPSV, :meth: `makepasv ` falls back to PASV automatically.
289+
290+ Set to ``False `` to restore the legacy PASV-first behavior on IPv4.
291+
292+ .. versionadded :: 3.15
293+
294+
279295 .. method :: FTP.set_pasv(val)
280296
281297 Enable "passive" mode if *val * is true, otherwise disable passive mode.
Original file line number Diff line number Diff line change 1- :mod: `ftplib `: :meth: ` ~ftplib.FTP.makepasv ` now prefers EPSV (RFC 2428) over
1+ :mod: `ftplib `: Passive mode data connections now prefer EPSV (RFC 2428) over
22PASV on IPv4 connections, falling back to PASV if the server does not support
33EPSV. EPSV is firewall-transparent as it does not embed an IP address in the
44response, avoiding interference from firewall FTP Application Layer Gateways
You can’t perform that action at this time.
0 commit comments