📄 ssl_intro.html
字号:
<table border="1" cellpadding="0" cellspacing="0" bordercolor="#AAAAAA" class="bordered">
<tr><th>Version</th><th>Source</th><th>Description</th><th>Browser Support</th></tr>
<tr><td>SSL v2.0</td><td>Vendor Standard (from Netscape Corp.) [<a href="#SSL2">SSL2</a>]</td><td>First SSL protocol for which implementations exists</td><td>- NS Navigator 1.x/2.x<br />
- MS IE 3.x<br />
- Lynx/2.8+OpenSSL</td></tr>
<tr><td>SSL v3.0</td><td>Expired Internet Draft (from Netscape Corp.) [<a href="#SSL3">SSL3</a>]</td><td>Revisions to prevent specific security attacks, add non-RSA
ciphers, and support for certificate chains</td><td>- NS Navigator 2.x/3.x/4.x<br />
- MS IE 3.x/4.x<br />
- Lynx/2.8+OpenSSL</td></tr>
<tr><td>TLS v1.0</td><td>Proposed Internet Standard (from IETF) [<a href="#TLS1">TLS1</a>]</td><td>Revision of SSL 3.0 to update the MAC layer to HMAC, add block
padding for block ciphers, message order standardization and more
alert messages.</td><td>- Lynx/2.8+OpenSSL</td></tr>
</table>
<p>如<a href="#table4">表4</a>所示,SSL协议有多种版本。SSL3.0的一个优点是增加了对加载证书链的支持,以允许服务器在发给浏览器的授予者证书上附加一个服务器证书。链的加载也允许浏览器验证服务器证书,即使对此授予者的证书机构证书并没有安装,因为它已经包含在这个证书链中了。SSL3.0目前正由Internet Engineering Task Force(IETF)研发,是传输层安全[<a href="#TLS1">TLS</a>]协议标准的基础。</p>
<h3><a name="session" id="session">会话的建立</a></h3>
<p>SSL会话在客户端和服务器的握手过程之后建立,如<a href="#figure1">Figure 1</a>所示,其过程可能因服务器是否配置为支持服务器证书和是否要求有客户证书有所不同。虽然存在密码信息管理需要额外握手操作的情况,本文只说明其中有共性的部分,参见所有可能情况下的SSL规范。</p>
<div class="note"><h3>说明</h3>
<p>SSL会话一旦建立就可能是可重用的,以避免在初始会话时的性能损失和许多步骤的重复。为此,服务器为其后的连接缓存了为每个SSL会话设定的唯一的会话标志,以减少握手操作(直到服务器缓存中的会话标志过期为止)。</p>
</div>
<p class="figure">
<img src="../images/ssl_intro_fig1.gif" alt="" width="423" height="327" /><br />
<a id="figure1" name="figure1"><dfn>Figure 1</dfn></a>: Simplified SSL
Handshake Sequence</p>
<p>客户端和服务器的握手过程如下所示:</p>
<ol>
<li>协商用于数据传输的密码组</li>
<li>建立并共享客户端和服务器的会话密钥</li>
<li>可选的客户端对服务器的认证</li>
<li>可选的服务器对客户端的认证</li>
</ol>
<p>第一步的密码组协商,允许客户端和服务器选择一个共同支持的密码组。SSL3.0协议规范定义了31个密码组。密码组由以下各部分组成:</p>
<ul>
<li>密钥交换法</li>
<li>数据传输密码</li>
<li>建立消息认证代码(Message Authentication Code[MAC])的消息摘要</li>
</ul>
<p>此三个组成部分说明如下。</p>
<h3><a name="keyexchange" id="keyexchange">密钥交换方法</a></h3>
<p>密钥交换法指明如何在客户端和服务器的数据传输中使用共享的对称密钥。SSL2.0仅使用RSA密钥交换,而SSL3.0可以在启用证书时,选择使用包括RSA的多种密钥交换算法,以及无须证书和客户端-服务器先期通讯的Diffie-Hellman密钥交换法。</p>
<p>密钥交换法的一个变数是数字签名(可用可不用),如果用,用哪一种。私有密钥配合签名可以确保在生成共享密钥[<a href="#AC96">AC96</a>, p516]的信息交换过程中抵御攻击。</p>
<h3><a name="ciphertransfer" id="ciphertransfer">数据传输密码</a></h3>
<p>SSL使用在前面加密对话消息中有所讲述的常规密码算法(对称密码),可以有包括不加密在内的九种选择:</p>
<ul>
<li>No encryption</li>
<li>Stream Ciphers
<ul>
<li>RC4 with 40-bit keys</li>
<li>RC4 with 128-bit keys</li>
</ul></li>
<li>CBC Block Ciphers
<ul><li>RC2 with 40 bit key</li>
<li>DES with 40 bit key</li>
<li>DES with 56 bit key</li>
<li>Triple-DES with 168 bit key</li>
<li>Idea (128 bit key)</li>
<li>Fortezza (96 bit key)</li>
</ul></li>
</ul>
<p>这里的"CBC"是Cipher Block Chaining,指在加密当前块时会用到先前已经加密的部分文本;"DES"是Data Encryption Standard[<a href="#AC96">AC96</a>, ch12],有多个变种(包括DES40和3DES_EDE);"Idea"是现有最好的最坚强的加密算法之一;"RC2"是RSADSI[<a href="#AC96">AC96</a>,
ch13]的专属的算法。</p>
<h3><a name="digestfuntion" id="digestfuntion">摘要函数</a></h3>
<p>摘要函数指明对一个记录单元如何建立摘要。SSL有如下支持:</p>
<ul>
<li>No digest (Null choice)</li>
<li>MD5, a 128-bit hash</li>
<li>Secure Hash Algorithm (SHA-1), a 160-bit hash</li>
</ul>
<p>消息摘要用于建立加密的消息认证码(MAC),与消息本身一同发送,以确保消息完整性并抵御还原攻击。</p>
<h3><a name="handshake" id="handshake">握手序列协议</a></h3>
<p>握手序列使用三个协议:</p>
<ul>
<li><dfn>SSL Handshake Protocol</dfn> ,以完成客户端和服务器之间对话的建立。</li>
<li><dfn>SSL Change Cipher Spec Protocol</dfn> ,以实际建立对话用密码组的约定。</li>
<li><dfn>SSL Alert Protocol</dfn> ,在客户端和服务器之间传输SSL出错消息。</li>
</ul>
<p>这些协议和应用协议的数据用 <dfn>SSL Record Protocol</dfn> 进行封装,如<a href="#figure2">Figure 2</a>所示,在不检查数据的较底层的协议中传输。封装协议对其底层协议来说是未知的。</p>
<p class="figure">
<img src="../images/ssl_intro_fig2.gif" alt="" width="428" height="217" /><br />
<a id="figure2" name="figure2"><dfn>Figure 2</dfn></a>: SSL Protocol Stack
</p>
<p>SSL控制协议对记录协议的封装,使一个正在进行的对话在重协商其控制协议后得以安全地进行传输。如果事先没有建立对话,则会使用Null密码组,也就是说,在建立对话以前,不使用密码,且消息没有完整性摘要。</p>
<h3><a name="datatransfer" id="datatransfer">数据传输</a></h3>
<p>SSL记录协议,如<a href="#figure3">Figure 3</a>所示,用于客户端和服务器之间的传输应用和SSL控制数据,可能把数据分割成较小的单元,或者组合多个较高层协议数据为一个单元。在使用底层可靠传输协议传输数据单元之前,它可能会对这些单元进行压缩、附着摘要签名和加密(注意:目前所有主要SSL的实现都缺乏对压缩的支持)。</p>
<p class="figure">
<img src="../images/ssl_intro_fig3.gif" alt="" width="423" height="323" /><br />
<a id="figure3" name="figure3"><dfn>Figure 3</dfn></a>: SSL Record Protocol
</p>
<h3><a name="securehttp" id="securehttp">保护HTTP通讯</a></h3>
<p>SSL的一个常见的用途是保护浏览器和网络服务器之间的网络HTTP通讯,但这并排除应用于不加保护的HTTP。其方法主要是,对普通HTTP加以SSL保护(称为HTTPS),但有一个重要的区别:它使用URL类型<code>https</code>而不是<code>http</code> ,而且使用不同的服务器端口(默认的是443)。<code class="module"><a href="../mod/mod_ssl.html">mod_ssl</a></code>为Apache网络服务器提供的功能主要就是这些了...</p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="references" id="references">References</a></h2>
<dl>
<dt><a id="AC96" name="AC96">[AC96]</a></dt>
<dd>Bruce Schneier, <q>Applied Cryptography</q>, 2nd Edition, Wiley,
1996. See <a href="http://www.counterpane.com/">http://www.counterpane.com/</a> for various other materials by Bruce
Schneier.</dd>
<dt><a id="X208" name="X208">[X208]</a></dt>
<dd>ITU-T Recommendation X.208, <q>Specification of Abstract Syntax Notation
One (ASN.1)</q>, 1988. See for instance <a href="http://www.itu.int/rec/recommendation.asp?type=items&lang=e&parent=T-REC-X.208-198811-I">http://www.itu.int/rec/recommendation.asp?type=items&lang=e&parent=T-REC-X.208-198811-I</a>.
</dd>
<dt><a id="X509" name="X509">[X509]</a></dt>
<dd>ITU-T Recommendation X.509, <q>The Directory - Authentication
Framework</q>. See for instance <a href="http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&parent=T-REC-X.509">http://www.itu.int/rec/recommendation.asp?type=folders&lang=e&parent=T-REC-X.509</a>.
</dd>
<dt><a id="PKCS" name="PKCS">[PKCS]</a></dt>
<dd><q>Public Key Cryptography Standards (PKCS)</q>,
RSA Laboratories Technical Notes, See <a href="http://www.rsasecurity.com/rsalabs/pkcs/">http://www.rsasecurity.com/rsalabs/pkcs/</a>.</dd>
<dt><a id="MIME" name="MIME">[MIME]</a></dt>
<dd>N. Freed, N. Borenstein, <q>Multipurpose Internet Mail Extensions
(MIME) Part One: Format of Internet Message Bodies</q>, RFC2045.
See for instance <a href="http://ietf.org/rfc/rfc2045.txt">http://ietf.org/rfc/rfc2045.txt</a>.</dd>
<dt><a id="SSL2" name="SSL2">[SSL2]</a></dt>
<dd>Kipp E.B. Hickman, <q>The SSL Protocol</q>, 1995. See <a href="http://www.netscape.com/eng/security/SSL_2.html">http://www.netscape.com/eng/security/SSL_2.html</a>.</dd>
<dt><a id="SSL3" name="SSL3">[SSL3]</a></dt>
<dd>Alan O. Freier, Philip Karlton, Paul C. Kocher, <q>The SSL Protocol
Version 3.0</q>, 1996. See <a href="http://www.netscape.com/eng/ssl3/draft302.txt">http://www.netscape.com/eng/ssl3/draft302.txt</a>.</dd>
<dt><a id="TLS1" name="TLS1">[TLS1]</a></dt>
<dd>Tim Dierks, Christopher Allen, <q>The TLS Protocol Version 1.0</q>,
1999. See <a href="http://ietf.org/rfc/rfc2246.txt">http://ietf.org/rfc/rfc2246.txt</a>.</dd>
</dl>
</div></div>
<div id="footer">
<p class="apache">本文允许自由使用、分发、转载,但必须保留译者署名;详见:<a href="../translator_announcement.html#announcement">译者声明</a>。</p>
<p class="menu"><a href="../mod/index.html">模块索引</a> | <a href="../mod/directives.html">指令索引</a> | <a href="../faq/index.html">常见问题</a> | <a href="../glossary.html">词汇表</a> | <a href="../sitemap.html">站点导航</a></p></div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -