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

SSL vs TLS vs STARTTLS

There's often quite a bit of confusion around the different terms SSL, TLS 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, TLS v1.3 (currently proposed).

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. SSL v2 was deprecated and phased out many years ago due to security issues. SSL v3 is currently deprecated due to security issues, and support has or is being phased out by most services these days. Almost all software supports TLS v1.0. As at October 2016, support for TLS v1.1 and TLS v1.2 is also very good, though there are some exceptions, mostly with Internet Explorer.

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 (known as a mail user agent) used SMTP on port 25 to submit messages to the email server for onward transmission to the destination (known as a mail transfer agent). 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 and encryption extensions were being defined for sMTP. So shortly after port 465 was defined, it was revoked with the expectation that clients would move to using STARTTLS over port 587

The result is that in most cases, systems that offer message submission over port 587require 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.

Unfortunately the downside of changing port numbers is that a number of email clients were made which only supported SSL/TLS over port 465 and not STARTTLS on 587. Clients are often very long lived, and so removing port 465 wasn't an option for many sites without annoying customers. Additionally, because port 465 was advertised as an option, many users with email clients that support both STARTTLS on 587 and SSL/TLS on 465 set them up to use 465 instead of 587. This makes it even harder to remove support for port 465, since lots of users have their email clients set up to use it.

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.

最新文章

  1. Spark java.lang.outofmemoryerror gc overhead limit exceeded 与 spark OOM:java heap space 解决方法
  2. JPA查询语句(转载)
  3. CCF认证(1)
  4. 安卓智能手持POS打印票据 扫描盘点移动开单软件/无线开单系统/PDA移动开单软件
  5. POJ1797 Heavy Transportation(SPFA)
  6. DevExpress控件-GridControl根据条件改变单元格/行颜色--转载
  7. WordPress插件制作教程概述
  8. Redis 与 Memcache
  9. linux下安装oracle11g 64位最简客户端(转)
  10. C++实现密码强度测试
  11. css的各种选择器
  12. pig加载两个不同字段个数的文件?load file with different items(f1有42列,f2有43列读到一个对象中)
  13. Java线程池ExecutorService 代码备忘
  14. (转载)【UGUI】侧面滑出的菜单栏,宽度自适应
  15. N! (数组)
  16. 2018-2019-2 《网络对抗技术》Exp3 免杀原理与实践 Week5 20165233
  17. xtu 1242 Yada Number 容斥原理
  18. Java基础教程(1)--概述
  19. C++解析(25):关于动态内存分配、虚函数和继承中强制类型转换的疑问
  20. [转]tomcat之一:指定tomcat运行时JDK版本

热门文章

  1. WebSphere异常:Servlet has become temporarily unavailable for service
  2. Erlang编程语言的一些痛点
  3. image 和 barplot 的组合
  4. 最近输入法的问题:关于ctrl + space 无法开关闭输入法的问题
  5. ubuntu16.04卸载tensorflow0.11版本,安装tensorflow1.1.0版本
  6. css 设置背景图片铺满固定不动
  7. 举例理解Hibernate的三种状态
  8. Oauth2.0(一):为什么需要 Oauth2.0 协议?
  9. ios开发之--条用第三方地图路线导航
  10. UITextField中文输入法输入时对字符长度的限制 输入时对字符类型的限制