<s>
FTPS	B-Protocol
(	O
also	O
known	O
as	O
FTP-SSL	B-Protocol
and	O
FTP	B-Protocol
Secure	I-Protocol
)	O
is	O
an	O
extension	O
to	O
the	O
commonly	O
used	O
File	B-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
FTP	B-Protocol
)	O
that	O
adds	O
support	O
for	O
the	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
(	O
TLS	B-Protocol
)	O
and	O
,	O
formerly	O
,	O
the	O
Secure	B-Protocol
Sockets	I-Protocol
Layer	I-Protocol
(	O
SSL	O
,	O
which	O
is	O
now	O
prohibited	O
by	O
RFC7568	O
)	O
cryptographic	O
protocols	O
.	O
</s>
<s>
FTPS	B-Protocol
should	O
not	O
be	O
confused	O
with	O
the	O
SSH	B-Protocol
File	I-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
SFTP	O
)	O
,	O
a	O
secure	O
file	B-Protocol
transfer	I-Protocol
subsystem	O
for	O
the	O
Secure	B-Protocol
Shell	I-Protocol
(	O
SSH	B-Protocol
)	O
protocol	O
with	O
which	O
it	O
is	O
not	O
compatible	O
.	O
</s>
<s>
It	O
is	O
also	O
different	O
from	O
FTP	B-Protocol
over	O
SSH	B-Protocol
,	O
which	O
is	O
the	O
practice	O
of	O
tunneling	O
FTP	B-Protocol
through	O
an	O
SSH	B-Protocol
connection	O
.	O
</s>
<s>
The	O
File	B-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
was	O
drafted	O
in	O
1971	O
for	O
use	O
with	O
the	O
scientific	O
and	O
research	O
network	O
,	O
ARPANET	O
.	O
</s>
<s>
In	O
1994	O
,	O
the	O
Internet	O
browser	O
company	O
Netscape	B-Protocol
developed	O
and	O
released	O
the	O
application	B-Application
layer	I-Application
wrapper	O
,	O
Secure	B-Protocol
Sockets	I-Protocol
Layer	I-Protocol
.	O
</s>
<s>
While	O
it	O
could	O
add	O
security	O
to	O
any	O
protocol	O
that	O
uses	O
reliable	O
connections	O
,	O
such	O
as	O
TCP	B-Protocol
,	O
it	O
was	O
most	O
commonly	O
used	O
by	O
Netscape	B-Protocol
with	O
HTTP	B-Protocol
to	O
form	O
HTTPS	B-Protocol
.	O
</s>
<s>
The	O
SSL	O
protocol	O
was	O
eventually	O
applied	O
to	O
FTP	B-Protocol
,	O
with	O
a	O
draft	O
Request	O
for	O
Comments	O
(	O
RFC	O
)	O
published	O
in	O
late	O
1996	O
.	O
</s>
<s>
Two	O
separate	O
methods	O
were	O
developed	O
to	O
invoke	O
client	O
security	O
for	O
use	O
with	O
FTP	B-Protocol
clients	I-Protocol
:	O
Implicit	O
and	O
Explicit	O
.	O
</s>
<s>
While	O
the	O
implicit	O
method	O
requires	O
that	O
a	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
is	O
established	O
from	O
the	O
beginning	O
of	O
the	O
connection	O
,	O
which	O
in	O
turn	O
breaks	O
the	O
compatibility	O
with	O
non-FTPS-aware	O
clients	O
and	O
servers	O
,	O
the	O
explicit	O
method	O
uses	O
standard	O
FTP	B-Protocol
protocol	I-Protocol
commands	O
and	O
replies	O
in	O
order	O
to	O
upgrade	O
a	O
plain	O
text	O
connection	O
to	O
an	O
encrypted	O
one	O
,	O
allowing	O
a	O
single	O
control	O
port	O
to	O
be	O
used	O
for	O
serving	O
both	O
FTPS-aware	O
and	O
non-FTPS-aware	O
clients	O
.	O
</s>
<s>
Negotiation	O
is	O
not	O
supported	O
with	O
implicit	O
FTPS	B-Protocol
configurations	O
.	O
</s>
<s>
A	O
client	O
is	O
immediately	O
expected	O
to	O
challenge	O
the	O
FTPS	B-Protocol
server	O
with	O
a	O
TLS	B-Protocol
ClientHello	O
message	O
.	O
</s>
<s>
If	O
such	O
a	O
message	O
is	O
not	O
received	O
by	O
the	O
FTPS	B-Protocol
server	O
,	O
the	O
server	O
should	O
drop	O
the	O
connection	O
.	O
</s>
<s>
In	O
order	O
to	O
maintain	O
compatibility	O
with	O
existing	O
non-FTPS-aware	O
clients	O
,	O
implicit	O
FTPS	B-Protocol
was	O
expected	O
to	O
listen	O
on	O
the	O
IANA	O
well	O
known	O
port	O
990/TCP	O
for	O
the	O
FTPS	B-Protocol
control	O
channel	O
,	O
and	O
port	O
989/TCP	O
for	O
the	O
FTPS	B-Protocol
data	O
channel	O
.	O
</s>
<s>
This	O
allowed	O
administrators	O
to	O
retain	O
legacy-compatible	O
services	O
on	O
the	O
original	O
21/TCP	O
FTP	B-Protocol
control	O
channel	O
.	O
</s>
<s>
As	O
such	O
,	O
it	O
is	O
considered	O
an	O
earlier	O
,	O
deprecated	O
method	O
of	O
negotiating	O
TLS/SSL	B-Protocol
for	O
FTP	B-Protocol
.	O
</s>
<s>
In	O
explicit	O
mode	O
(	O
also	O
known	O
as	O
FTPES	B-Protocol
)	O
,	O
an	O
FTPS	B-Protocol
client	O
must	O
"	O
explicitly	O
request	O
"	O
security	O
from	O
an	O
FTPS	B-Protocol
server	O
and	O
then	O
step	O
up	O
to	O
a	O
mutually	O
agreed	O
encryption	O
method	O
.	O
</s>
<s>
If	O
a	O
client	O
does	O
not	O
request	O
security	O
,	O
the	O
FTPS	B-Protocol
server	O
can	O
either	O
allow	O
the	O
client	O
to	O
continue	O
in	O
insecure	O
mode	O
or	O
refuse	O
the	O
connection	O
.	O
</s>
<s>
The	O
mechanism	O
for	O
negotiating	O
authentication	O
and	O
security	O
with	O
FTP	B-Protocol
was	O
added	O
under	O
RFC	O
2228	O
,	O
which	O
included	O
the	O
new	O
FTP	B-Protocol
command	O
AUTH	O
.	O
</s>
<s>
SSL	O
or	O
TLS	B-Protocol
,	O
it	O
does	O
require	O
the	O
FTPS	B-Protocol
client	O
to	O
challenge	O
the	O
FTPS	B-Protocol
server	O
with	O
a	O
mutually	O
known	O
mechanism	O
.	O
</s>
<s>
If	O
the	O
FTPS	B-Protocol
client	O
challenges	O
the	O
FTPS	B-Protocol
server	O
with	O
an	O
unknown	O
security	O
mechanism	O
,	O
the	O
FTPS	B-Protocol
server	O
will	O
respond	O
to	O
the	O
AUTH	O
command	O
with	O
error	O
code	O
504	O
(	O
not	O
supported	O
)	O
.	O
</s>
<s>
Clients	O
may	O
determine	O
which	O
mechanisms	O
are	O
supported	O
by	O
querying	O
the	O
FTPS	B-Protocol
server	O
with	O
the	O
FEAT	O
command	O
,	O
although	O
servers	O
are	O
not	O
necessarily	O
required	O
to	O
be	O
honest	O
in	O
disclosing	O
what	O
levels	O
of	O
security	O
they	O
support	O
.	O
</s>
<s>
Common	O
methods	O
of	O
invoking	O
FTPS	B-Protocol
security	O
included	O
AUTH	O
TLS	B-Protocol
and	O
AUTH	O
SSL	O
.	O
</s>
<s>
In	O
the	O
later	O
versions	O
of	O
the	O
document	O
,	O
FTPS	B-Protocol
compliance	O
required	O
that	O
clients	O
always	O
negotiate	O
using	O
the	O
AUTH	O
TLS	B-Protocol
method	O
.	O
</s>
<s>
FTPS	B-Protocol
includes	O
full	O
support	O
for	O
the	O
TLS	B-Protocol
and	O
SSL	O
cryptographic	O
protocols	O
,	O
including	O
the	O
use	O
of	O
server-side	O
public	O
key	O
authentication	O
certificates	O
and	O
client-side	O
authorization	O
certificates	O
.	O
</s>
<s>
It	O
also	O
supports	O
compatible	O
ciphers	O
,	O
including	O
AES	B-Algorithm
,	O
RC4	B-Algorithm
,	O
RC2	B-Algorithm
,	O
Triple	B-Algorithm
DES	I-Algorithm
,	O
and	O
DES	B-Algorithm
.	O
</s>
<s>
It	O
further	O
supports	O
hash	O
functions	O
SHA	O
,	O
MD5	B-Algorithm
,	O
MD4	B-Algorithm
,	O
and	O
MD2	B-Algorithm
.	O
</s>
<s>
In	O
implicit	O
mode	O
,	O
the	O
entire	O
FTPS	B-Protocol
session	O
is	O
encrypted	O
.	O
</s>
<s>
Enabling	O
and	O
disabling	O
of	O
encryption	O
for	O
the	O
FTPS	B-Protocol
control	O
channel	O
and	O
FTPS	B-Protocol
data	O
channel	O
can	O
occur	O
at	O
any	O
time	O
.	O
</s>
<s>
The	O
only	O
restriction	O
comes	O
from	O
the	O
FTPS	B-Protocol
server	O
,	O
which	O
has	O
the	O
ability	O
to	O
deny	O
commands	O
based	O
on	O
server	O
encryption	O
policy	O
.	O
</s>
<s>
The	O
secure	O
command	O
channel	O
mode	O
can	O
be	O
entered	O
through	O
the	O
issue	O
of	O
either	O
the	O
AUTH	O
TLS	B-Protocol
or	O
AUTH	O
SSL	O
commands	O
.	O
</s>
<s>
After	O
such	O
time	O
,	O
all	O
command	O
control	O
between	O
the	O
FTPS	B-Protocol
client	O
and	O
server	O
are	O
assumed	O
to	O
be	O
encrypted	O
.	O
</s>
<s>
It	O
is	O
not	O
enabled	O
by	O
default	O
when	O
the	O
AUTH	O
TLS	B-Protocol
command	O
is	O
issued	O
.	O
</s>
<s>
After	O
such	O
time	O
,	O
all	O
data	O
channel	O
communication	O
between	O
the	O
FTPS	B-Protocol
client	O
and	O
server	O
is	O
assumed	O
to	O
be	O
encrypted	O
.	O
</s>
<s>
The	O
FTPS	B-Protocol
client	O
may	O
exit	O
the	O
secure	O
data	O
channel	O
mode	O
at	O
any	O
time	O
by	O
issuing	O
a	O
CDC	O
(	O
clear	O
data	O
channel	O
)	O
command	O
.	O
</s>
<s>
Files	O
being	O
transferred	O
are	O
already	O
encrypted	O
at	O
the	O
file	O
level	O
or	O
are	O
passing	O
over	O
an	O
encrypted	O
VPN	B-Application
,	O
making	O
encryption	O
redundant	O
,	O
</s>
<s>
Available	O
TLS	B-Protocol
or	O
SSL	B-Protocol
encryption	I-Protocol
modes	O
do	O
not	O
meet	O
desired	O
level	O
of	O
encryption	O
.	O
</s>
<s>
This	O
is	O
common	O
with	O
older	O
FTPS	B-Protocol
clients	O
or	O
servers	O
that	O
may	O
have	O
been	O
limited	O
to	O
40-bit	O
SSL	O
due	O
to	O
previous	O
United	O
States	O
high-encryption	O
export	O
laws	O
.	O
</s>
<s>
Use	O
of	O
FTPS	B-Protocol
when	O
the	O
client	O
or	O
server	O
reside	O
behind	O
a	O
network	B-Application
firewall	I-Application
or	O
network	B-Protocol
address	I-Protocol
translation	I-Protocol
(	O
NAT	O
)	O
device	O
.	O
</s>
<s>
(	O
See	O
Firewall	B-Application
Incompatibilities	O
below	O
.	O
)	O
</s>
<s>
Repeated	O
use	O
of	O
AUTH	O
and	O
CCC/CDC	O
commands	O
by	O
anonymous	O
FTP	B-Protocol
clients	I-Protocol
within	O
the	O
same	O
session	O
.	O
</s>
<s>
Such	O
behavior	O
can	O
be	O
used	O
as	O
a	O
resource-based	O
denial	O
of	O
service	O
attack	O
as	O
the	O
TLS/SSL	B-Protocol
session	O
must	O
be	O
regenerated	O
each	O
time	O
,	O
using	O
server	O
processor	O
time	O
.	O
</s>
<s>
Much	O
like	O
HTTPS	B-Protocol
,	O
FTPS	B-Protocol
servers	O
must	O
provide	O
a	O
public	O
key	O
certificate	O
.	O
</s>
<s>
These	O
certificates	O
can	O
be	O
requested	O
and	O
created	O
using	O
tools	O
such	O
as	O
OpenSSL	B-Language
.	O
</s>
<s>
When	O
these	O
certificates	O
are	O
signed	O
by	O
a	O
trusted	O
certificate	B-Architecture
authority	I-Architecture
,	O
this	O
provides	O
assurance	O
that	O
the	O
client	O
is	O
connected	O
to	O
the	O
requested	O
server	O
,	O
avoiding	O
a	O
man-in-the-middle	O
attack	O
.	O
</s>
<s>
If	O
the	O
certificate	O
is	O
not	O
signed	O
by	O
a	O
trusted	O
CA	O
(	O
a	O
self-signed	B-Protocol
certificate	I-Protocol
)	O
,	O
the	O
FTPS	B-Protocol
client	O
may	O
generate	O
a	O
warning	O
stating	O
that	O
the	O
certificate	O
is	O
not	O
valid	O
.	O
</s>
<s>
This	O
is	O
in	O
contrast	O
to	O
the	O
SSH	B-Protocol
File	I-Protocol
Transfer	I-Protocol
Protocol	I-Protocol
(	O
SFTP	O
)	O
,	O
which	O
does	O
not	O
present	O
signed	O
certificates	O
,	O
but	O
instead	O
relies	O
on	O
Out-of-band	O
authentication	O
of	O
public	O
keys	O
.	O
</s>
<s>
Because	O
FTP	B-Protocol
uses	O
a	O
dynamic	O
secondary	O
port	O
(	O
for	O
data	O
channels	O
)	O
,	O
many	O
firewalls	B-Application
were	O
designed	O
to	O
snoop	O
FTP	B-Protocol
protocol	I-Protocol
control	O
messages	O
in	O
order	O
to	O
determine	O
which	O
secondary	O
data	O
connections	O
they	O
need	O
to	O
allow	O
.	O
</s>
<s>
However	O
,	O
if	O
the	O
FTP	B-Protocol
control	O
connection	O
is	O
encrypted	O
using	O
TLS/SSL	B-Protocol
,	O
the	O
firewall	B-Application
cannot	O
determine	O
the	O
TCP	B-Protocol
port	O
number	O
of	O
a	O
data	O
connection	O
negotiated	O
between	O
the	O
client	O
and	O
FTP	B-Protocol
server	I-Protocol
.	O
</s>
<s>
Therefore	O
,	O
in	O
many	O
firewalled	O
networks	O
,	O
an	O
FTPS	B-Protocol
deployment	O
will	O
fail	O
when	O
an	O
unencrypted	O
FTP	B-Protocol
deployment	O
will	O
work	O
.	O
</s>
<s>
This	O
problem	O
can	O
be	O
solved	O
with	O
the	O
use	O
of	O
a	O
limited	O
range	O
of	O
ports	O
for	O
data	O
and	O
configuring	O
the	O
firewall	B-Application
to	O
open	O
these	O
ports	O
.	O
</s>
