SSL vs TLS vs STARTTLS (转)

There‘s often quite a bit of confusion around the different terms SSLTLS and STARTTLS.

SSL and TLS both provide a way to encrypt a communication channel between two computers (e.g. your computer and our server). TLS is the successor to SSL and the terms SSL and TLS are used interchangeably unless you‘re referring to a specific version of the protocol.

STARTTLS is a way to take an existing insecure connection and upgrade it to a secure connection using SSL/TLS. Note that despite having TLS in the name, STARTTLS doesn‘t mean you have to use TLS, you can use SSL.

SSL/TLS version numbers

Version numbering is inconsistent between SSL and TLS versions. When TLS took over from SSL as the preferred protocol name, it began a new version number, and also began using sub-versions. So the ordering of protocols in terms of oldest to newest is: SSL v2, SSL v3, TLS v1.0, TLS v1.1, TLS v1.2.

When you connect to an SSL/TLS encrypted port, or use STARTTLS to upgrade an existing connection, both sides will negotiate which protocol and which version to use based on what has been configured in the software and what each side supports.

Support for SSL/TLS is virtually universal these days, however which versions are supported is variable. Pretty much everything supports SSL v3 (except a few very old Palm Treo devicesas we discovered). Most things support TLS v1.0. As at May 2012, support for TLS v1.1 and TLS v1.2 is more limited.

TLS vs STARTTLS naming problem

One significant complicating factor is that some email software incorrectly uses the term TLS when they should have used STARTTLS. Older versions of Thunderbird in particular used "TLS" to mean "enforce use of STARTTLS to upgrade the connection, and fail if STARTTLS is not supported" and "TLS, if available" to mean "use STARTTLS to upgrade the connection if the server advertises support for it, otherwise just use an insecure connection".

SSL/TLS vs plaintext/STARTTLS port numbers

The above is particularly problematic when combined with having to configure a port number for each protocol.

To add security to some existing protocols (e.g. IMAP, POP, etc.), it was decided to just add SSL/TLS encryption as a layer underneath the existing protocol. However, to distinguish that software should talk the SSL/TLS encrypted version of the protocol rather than the plaintext one, a different port number was used for each protocol. So you have:

  • IMAP uses port 143, but SSL/TLS encrypted IMAP uses port 993.
  • POP uses port 110, but SSL/TLS encrypted POP uses port 995.
  • SMTP uses port 25, but SSL/TLS encrypted SMTP uses port 465.

At some point, it was decided that having 2 ports for every protocol was wasteful, and instead you should have 1 port that starts off as plaintext, but the client can upgrade the connection to an SSL/TLS encrypted one. This is what STARTTLS was created to do.

There were a few problems with this though. There was already existing software that used the alternate port numbers with pure SSL/TLS connections. Client software can be very long lived, so you can‘t just disable the encrypted ports until all software has been upgraded.

Mechanisms were added to each protocol to tell clients that the plaintext protocol supported upgrading to SSL/TLS (i.e. STARTTLS), and that they should not attempt to log in without doing the STARTTLS upgrade. This created two unfortunate situations:

  1. Some software just ignored the "login disabled until upgraded"announcement and just tried to log in anyway, sending the username and password over plaintext. Even if the server then rejected the login, the details had already been sent over the Internet in plaintext.
  2. Other software saw the "login disabled until upgraded" announcement, but then wouldn‘t upgrade the connection automatically, and thus reported login errors back to the user, which caused confusion about what was wrong.

Both of these problems resulted in significant compatibility issues with existing clients, and so most system administrators continued to just use plaintext connections on one port number, and encrypted connections on a separate port number.

This has now basically become the de facto standard that everyone uses. IMAP SSL/TLS encrypted over port 993 or POP SSL/TLS encrypted over port 995. Many sites (including FastMail) now disable plain IMAP (port 143) and plain POP (port 110) altogether so people must use an SSL/TLS encrypted connection. By disabling ports 143 and 110, this removes completely STARTTLS as even an option for IMAP/POP connections.

SMTP STARTTLS as an exception

The one real exception to the above is SMTP. However that‘s for a different reason again. Most email software used SMTP on port 25 to submit messages to the email server for onward transmission to the destination. However, SMTP was originally designed for transfer, not submission. So yet another port (587) was defined for message submission. Although port 587 doesn‘t mandate requiring STARTTLS, the use of port 587 became popular around the same time as the realisation that SSL/TLS encryption of communications between clients and servers was an important security and privacy issue.

The result is that in most cases, systems that offer message submission over port 587 require clients to use STARTLS to upgrade the connection and also require a username and password to authenticate. There has been an added benefit to this approach as well. By moving users away from using port 25 for email submission, ISPs are now able to block outgoing port 25 connections from users‘ computers, which were a significant source of spam due to infection with spam-sending viruses.

Currently, things seem relatively randomly split between people using SMTP SSL/TLS encrypted over port 465, and people using SMTP with STARTTLS upgrading over port 587.

References

http://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/

https://www.fastmail.com/help/technical/ssltlsstarttls.html

时间: 2024-08-07 00:16:34

SSL vs TLS vs STARTTLS (转)的相关文章

SSL与TLS的区别以及介绍

http://kb.cnblogs.com/page/197396/ SSL 和TLS协议 http://blog.csdn.net/fangaoxin/article/details/6942312 SSL:(Secure Socket Layer,安全套接字层),位于可靠的面向连接的网络层协议和应用层协议之间的一种协议层.SSL通过互相认证.使用数字签名确保完整性.使用加密确保 私密性,以实现客户端和服务器之间的安全通讯.该协议由两层组成:SSL记录协议和SSL握手协议. TLS:(Tran

安全协议系列(四)----SSL与TLS

当今社会,电子商务大行其道,作为网络安全 infrastructure 之一的 -- SSL/TLS 协议的重要性已不用多说.OpenSSL 则是基于该协议的目前应用最广泛的开源实现,其影响之大,以至于四月初爆出的 OpenSSL Heartbleed 安全漏洞(CVE-2014-0160) 到现在还余音未消. 本节就以出问题的 OpenSSL 1.0.1f 作为实例进行分析:整个分析过程仍采用[参考 RFC.结合报文抓包.外加工具验证]的老方法.同时我们利用 OpenSSL 自带的调试功能,来

Burpsuite如何抓取使用了SSL或TLS传输的 IOS App流量

之前一篇文章介绍了Burpsuite如何抓取使用了SSL或TLS传输的Android App流量,那么IOS中APP如何抓取HTTPS流量呢, 套路基本上与android相同,唯一不同的是将证书导入ios设备的过程中有些出路,下面进行详细介绍. 以抓包工具burpsuite为例,如果要想burpsuite能抓取IOS设备上的HTTPS流量首先是要将burpsuite的证书导入到ios设备中, burpsuite的证书如何获取并保存在本地pc上请参考here. burpsuite的证书拿到了后就要

SSL与TLS的区别

SSL(Secure Socket Layer 安全套接层)是基于HTTPS下的一个协议加密层,最初是由网景公司(Netscape)研发,后被IETF(The Internet Engineering Task Force - 互联网工程任务组)标准化后写入(RFCRequest For Comments 请求注释),RFC里包含了很多互联网技术的规范! 起初是因为HTTP在传输数据时使用的是明文(虽然说POST提交的数据时放在报体里看不到的,但是还是可以通过抓包工具窃取到)是不安全的,为了解决

HTTPS、SSL、TLS三者之间有什么联系和区别?

SSL(Secure Socket Layer 安全套接层)是基于HTTPS下的一个协议加密层,最初是由网景公司(Netscape)研发,后被IETF(The Internet Engineering Task Force - 互联网工程任务组)标准化后写入(RFCRequest For Comments 请求注释),RFC里包含了很多互联网技术的规范! 起初是因为HTTP在传输数据时使用的是明文(虽然说POST提交的数据时放在报体里看不到的,但是还是可以通过抓包工具窃取到)是不安全的,为了解决

SSL和TLS的技术原理浅谈

背景 程序员小明想给隔壁红写信表白,但是又不想让信件内容被其他人看见,希望只有小红才能看见信件内容,迫不及待的小明的大脑飞快运转起来. 预备基础知识 对称密钥加密(Symmetric Key Cryptography):加密与解密使用相同密钥.对称加密算法的特点是算法公开.计算量小.加密速度快.加密效率高.缺点是交易双方都使用同样钥匙,安全性得不到保证. 非对称密钥加密(Asymmetric Key Cryptography):加密与解密使用不同密钥.非对称加密使用一对秘钥,一个用来加密,一个用

SSL与TLS的不同

SSL 与 TLS 1 SSL (Secure Socket Layer,安全套接字层) SSL为Netscape所研发,用以保障在Internet上数据传输之安全,利用数据加密(Encryption)技术,可确保数据在网络上之传输过程中不会被截取,当前为3.0版本. SSL协议可分为两层: SSL记录协议(SSL Record Protocol):它建立在可靠的传输协议(如TCP)之上,为高层协议提供数据封装.压缩.加密等基本功能的支持. SSL握手协议(SSL Handshake Proto

openssl、x509、crt、cer、key、csr、ssl、tls 这些都是什么鬼?

今天尝试在mac机上搭建docker registry私有仓库时,杯具的发现最新的registry出于安全考虑,强制使用ssl认证,于是又详细了解linux/mac上openssl的使用方法,接触了一堆新英文缩写,整理于下: TLS:传输层安全协议 Transport Layer Security的缩写 SSL:安全套接字层 Secure Socket Layer的缩写 TLS与SSL对于不是专业搞安全的开发人员来讲,可以认为是差不多的,这二者是并列关系,详细差异见 http://kb.cnbl

ssl与tls的差别

1)版本号:TLS记录格式与SSL记录格式相同,但版本号的值不同,TLS的版本1.0便 用的版 本号为SSLv3.1. 2) 报文鉴别码:SSLv3.0和TLS的MAC算法的范围不同,但两者的安全层度是相同的. 3)报警代码:TLS支持几乎所有的SSLv3.0报警代码,而且TLS还补充定义了很多报警代码,如解密失败(decryption_failed). 记录溢出(record_overflow).未知CA(unknown_ca).拒绝访问(access_denied)等. TLS的主要增强内容