<s>
Opportunistic	B-Protocol
TLS	I-Protocol
(	O
Transport	B-Protocol
Layer	I-Protocol
Security	I-Protocol
)	O
refers	O
to	O
extensions	O
in	O
plain	O
text	O
communication	O
protocols	O
,	O
which	O
offer	O
a	O
way	O
to	O
upgrade	O
a	O
plain	O
text	O
connection	O
to	O
an	O
encrypted	O
(	O
TLS	B-Protocol
or	O
SSL	B-Protocol
)	O
connection	O
instead	O
of	O
using	O
a	O
separate	O
port	O
for	O
encrypted	O
communication	O
.	O
</s>
<s>
Several	O
protocols	O
use	O
a	O
command	O
named	O
"	O
STARTTLS	B-Protocol
"	O
for	O
this	O
purpose	O
.	O
</s>
<s>
It	O
is	O
a	O
form	O
of	O
opportunistic	B-Protocol
encryption	I-Protocol
and	O
is	O
primarily	O
intended	O
as	O
a	O
countermeasure	O
to	O
passive	O
monitoring	O
.	O
</s>
<s>
The	O
STARTTLS	B-Protocol
command	O
for	O
IMAP	B-Protocol
and	O
POP3	B-Protocol
is	O
defined	O
in	O
,	O
for	O
SMTP	B-Protocol
in	O
,	O
for	O
XMPP	B-Protocol
in	O
and	O
for	O
NNTP	B-Protocol
in	O
.	O
</s>
<s>
For	O
IRC	B-Protocol
,	O
the	O
IRCv3	B-Protocol
Working	O
Group	O
has	O
defined	O
the	O
STARTTLS	B-Protocol
extension	O
.	O
</s>
<s>
FTP	B-Protocol
uses	O
the	O
command	O
"	O
AUTH	O
TLS	B-Protocol
"	O
defined	O
in	O
and	O
LDAP	B-Protocol
defines	O
a	O
protocol	O
extension	O
OID	O
in	O
.	O
</s>
<s>
HTTP	B-Protocol
uses	O
upgrade	B-Protocol
header	I-Protocol
.	O
</s>
<s>
TLS	B-Protocol
is	O
application-neutral	O
;	O
in	O
the	O
words	O
of	O
:	O
</s>
<s>
One	O
advantage	O
of	O
TLS	B-Protocol
is	O
that	O
it	O
is	O
application	O
protocol	O
independent	O
.	O
</s>
<s>
Higher-level	O
protocols	O
can	O
layer	O
on	O
top	O
of	O
the	O
TLS	B-Protocol
protocol	I-Protocol
transparently	O
.	O
</s>
<s>
The	O
TLS	B-Protocol
standard	O
,	O
however	O
,	O
does	O
not	O
specify	O
how	O
protocols	O
add	O
security	O
with	O
TLS	B-Protocol
;	O
the	O
decisions	O
on	O
how	O
to	O
initiate	O
TLS	B-Protocol
handshaking	O
and	O
how	O
to	O
interpret	O
the	O
authentication	O
certificates	O
exchanged	O
are	O
left	O
to	O
the	O
judgment	O
of	O
the	O
designers	O
and	O
implementors	O
of	O
protocols	O
that	O
run	O
on	O
top	O
of	O
TLS	B-Protocol
.	O
</s>
<s>
The	O
style	O
used	O
to	O
specify	O
how	O
to	O
use	O
TLS	B-Protocol
matches	O
the	O
same	O
layer	O
distinction	O
that	O
is	O
also	O
conveniently	O
supported	O
by	O
several	O
library	O
implementations	O
of	O
TLS	B-Protocol
.	O
</s>
<s>
E.g.	O
,	O
the	O
SMTP	B-Protocol
extension	O
illustrates	O
with	O
the	O
following	O
dialog	O
how	O
a	O
client	O
and	O
server	O
can	O
start	O
a	O
secure	O
session	O
:	O
</s>
<s>
The	O
last	O
EHLO	B-Protocol
command	O
above	O
is	O
issued	O
over	O
a	O
secure	O
channel	O
.	O
</s>
<s>
Note	O
that	O
authentication	O
is	O
optional	O
in	O
SMTP	B-Protocol
,	O
and	O
the	O
omitted	O
server	O
reply	O
may	O
now	O
safely	O
advertise	O
an	O
AUTH	O
PLAIN	O
SMTP	B-Protocol
extension	O
,	O
which	O
is	O
not	O
present	O
in	O
the	O
plain-text	O
reply	O
.	O
</s>
<s>
Besides	O
the	O
use	O
of	O
opportunistic	B-Protocol
TLS	I-Protocol
,	O
a	O
number	O
of	O
TCP	O
ports	O
were	O
defined	O
for	O
SSL-secured	O
versions	O
of	O
well-known	O
protocols	O
.	O
</s>
<s>
Separate	O
SSL	B-Protocol
ports	O
have	O
the	O
advantage	O
of	O
fewer	O
round-trips	O
;	O
also	O
less	O
meta-data	O
is	O
transmitted	O
in	O
unencrypted	O
form	O
.	O
</s>
<s>
At	O
least	O
for	O
the	O
email	O
related	O
protocols	O
,	O
favors	O
separate	O
SSL	B-Protocol
ports	O
instead	O
of	O
STARTTLS	B-Protocol
.	O
</s>
<s>
Opportunistic	B-Protocol
TLS	I-Protocol
is	O
an	O
opportunistic	B-Protocol
encryption	I-Protocol
mechanism	O
.	O
</s>
<s>
Because	O
the	O
initial	O
handshake	O
takes	O
place	O
in	O
plain	O
text	O
,	O
an	O
attacker	O
in	O
control	O
of	O
the	O
network	O
can	O
modify	O
the	O
server	O
messages	O
via	O
a	O
man-in-the-middle	O
attack	O
to	O
make	O
it	O
appear	O
that	O
TLS	B-Protocol
is	O
unavailable	O
(	O
called	O
a	O
STRIPTLS	O
attack	O
)	O
.	O
</s>
<s>
Most	O
SMTP	B-Protocol
clients	O
will	O
then	O
send	O
the	O
email	O
and	O
possibly	O
passwords	O
in	O
plain	O
text	O
,	O
often	O
with	O
no	O
notification	O
to	O
the	O
user	O
.	O
</s>
<s>
In	O
particular	O
,	O
many	O
SMTP	B-Protocol
connections	O
occur	O
between	O
mail	B-Protocol
servers	I-Protocol
,	O
where	O
user	O
notification	O
is	O
not	O
practical	O
.	O
</s>
<s>
STRIPTLS	O
attacks	O
can	O
be	O
blocked	O
by	O
configuring	O
SMTP	B-Protocol
clients	O
to	O
require	O
TLS	B-Protocol
for	O
outgoing	O
connections	O
(	O
for	O
example	O
,	O
the	O
Exim	B-Protocol
Message	B-Protocol
transfer	I-Protocol
agent	I-Protocol
can	O
require	O
TLS	B-Protocol
via	O
the	O
directive	O
"	O
hosts_require_tls	O
"	O
)	O
.	O
</s>
<s>
However	O
,	O
since	O
not	O
every	O
mail	B-Protocol
server	I-Protocol
supports	O
TLS	B-Protocol
,	O
it	O
is	O
not	O
practical	O
to	O
simply	O
require	O
TLS	B-Protocol
for	O
all	O
connections	O
.	O
</s>
<s>
This	O
problem	O
is	O
addressed	O
by	O
DNS-based	B-Protocol
Authentication	I-Protocol
of	I-Protocol
Named	I-Protocol
Entities	I-Protocol
(	O
DANE	O
)	O
,	O
a	O
part	O
of	O
DNSSEC	B-Protocol
,	O
and	O
in	O
particular	O
by	O
for	O
SMTP	B-Protocol
.	O
</s>
<s>
DANE	O
allows	O
to	O
advertise	O
support	O
for	O
secure	B-Protocol
SMTP	I-Protocol
via	O
a	O
TLSA	B-Protocol
record	O
.	O
</s>
<s>
This	O
tells	O
connecting	O
clients	O
they	O
should	O
require	O
TLS	B-Protocol
,	O
thus	O
preventing	O
STRIPTLS	O
attacks	O
.	O
</s>
<s>
The	O
STARTTLS	B-Protocol
Everywhere	O
project	O
from	O
the	O
Electronic	O
Frontier	O
Foundation	O
works	O
in	O
a	O
similar	O
way	O
.	O
</s>
<s>
However	O
,	O
DNSSEC	B-Protocol
,	O
due	O
to	O
deployment	O
complexities	O
and	O
peculiar	O
criticism	O
,	O
faced	O
a	O
low	O
adoption	O
rate	O
and	O
a	O
new	O
protocol	O
called	O
SMTP	B-Protocol
MTA	O
Strict	O
Transport	O
Security	O
or	O
MTA-STS	O
has	O
been	O
drafted	O
by	O
a	O
group	O
of	O
major	O
email	O
service	O
providers	O
including	O
Microsoft	O
,	O
Google	O
and	O
Yahoo	O
.	O
</s>
<s>
MTA-STS	O
does	O
not	O
require	O
the	O
use	O
of	O
DNSSEC	B-Protocol
to	O
authenticate	O
DANE	O
TLSA	B-Protocol
records	O
but	O
relies	O
on	O
the	O
certificate	B-Architecture
authority	I-Architecture
(	O
CA	O
)	O
system	O
and	O
a	O
trust-on-first-use	O
(	O
TOFU	O
)	O
approach	O
to	O
avoid	O
interceptions	O
.	O
</s>
<s>
The	O
TOFU	O
model	O
reduces	O
complexity	O
but	O
without	O
the	O
guarantees	O
on	O
first	O
use	O
offered	O
by	O
DNSSEC	B-Protocol
.	O
</s>
<s>
Following	O
the	O
revelations	O
made	O
by	O
Edward	O
Snowden	O
in	O
light	O
of	O
the	O
global	O
mass	O
surveillance	O
scandal	O
,	O
popular	O
email	O
providers	O
have	O
bettered	O
their	O
email	O
security	O
by	O
enabling	O
STARTTLS	B-Protocol
.	O
</s>
<s>
Facebook	B-Application
reported	O
that	O
after	O
enabling	O
STARTTLS	B-Protocol
and	O
encouraging	O
other	O
providers	O
to	O
do	O
the	O
same	O
,	O
until	O
Facebook	B-Application
discontinued	O
its	O
email	O
service	O
in	O
February	O
2014	O
,	O
95%	O
of	O
outbound	O
email	O
was	O
encrypted	O
with	O
both	O
Perfect	O
Forward	O
Secrecy	O
and	O
strict	O
certificate	O
validation	O
.	O
</s>
