Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build_test_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ cd ftpd

ftpd_dir=`pwd`

curl -O ftp://ftp.proftpd.org/distrib/source/proftpd-1.3.5.tar.gz
tar -xzf proftpd-1.3.5.tar.gz
cd proftpd-1.3.5
curl -L -O https://github.com/proftpd/proftpd/archive/v1.3.5e.tar.gz
tar -xzf v1.3.5e.tar.gz
cd proftpd-1.3.5e

# fix slow tls data connection handshake (https://github.com/proftpd/proftpd/pull/48)
perl -pi -e 's/(\Qpr_inet_set_proto_nodelay(conn->pool, conn, 1);\E)/$1\n(void) pr_inet_set_proto_cork(conn->wfd, 0);/' contrib/mod_tls.c
Expand Down
5 changes: 4 additions & 1 deletion persistent_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,10 @@ func (pconn *persistentConn) prepareDataConn() (func() (net.Conn, error), error)
}

if pconn.config.TLSConfig != nil {
dc = tls.Server(dc, pconn.config.TLSConfig)
// based on RFC 4217, section 7, for active connections
// the FTP client MUST be the TLS client and the FTP
// server MUST be the TLS server
dc = tls.Client(dc, pconn.config.TLSConfig)
pconn.debug("upgraded active connection to TLS")
}

Expand Down