I get this error when trying to do an FTP upload using TLS/SSL:
LocalFilename: d:\work\TEST FILE.txt
RemoteFilename: TEST FILE.txt
DllDate: Nov 12 2007
Component: .NET 2.0
Active transfer mode
PortReply: 504 Invalid PORT address
Failed to setup active data socket.
Try using passive mode instead.
The "504 Invalid PORT Address" is because your NAT Router (Network Address Translating Router) was not able to modify the IP address (192.168.1.50) from an internal IP to an external one because the control channel is SSL. Therefore, try calling ClearControlChannel immediately after connecting. If your FTP server supports it, your control channel will be unencrypted, but the data transmissions will remain encrypted. This allows your router to translate the IP from internal IPs to external IPs.
Keep the Passive property = false.
Make sure to check the return value of ClearControlChannel to ensure that it succeeded.