⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssl.html

📁 struts api,学习使用struts必备的文档
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Secure Socket Layer and Web Applications - Apache Struts</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<meta content="Steve Ditlinger" name="author" />
<link href="../struts.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="heading">
<a href="http://apache.org/">
<img id="asf_logo_wide" alt="The Apache Project" src="../images/asf_logo_wide.gif" />
</a>
<a href="http://struts.apache.org/">
<img id="struts-logo" alt="Struts Framework" src="../images/struts.gif" />
</a>
</div>
<!--end heading-->
<div id="content">
<div id="menu">

    

    <p>FAQs</p>
<ul>
        <li>
<a href="kickstart.html">Kickstart</a>
</li>
        <li>
<a href="newbie.html">Newbie</a>
</li>
        <li>
<a href="helping.html">How to Help</a>
</li>
    </ul>

    <p>Howto Guides</p>
<ul>
        <li>
<a href="actionForm.html">Action Forms</a>
</li>
        <li>
<a href="apps.html">Building Apps</a>
</li>
        <li>
<a href="database.html">Database</a>
</li>
        <li>
<a href="indexedprops.html">Indexed Properties</a>
</li>
        <li>
<a href="ssl.html">SSL</a>
</li>

        <li>
<a href="struts-el.html">Struts-EL (JSTL)</a>
</li>
    </ul>

    <p>IDE Guides</p>
<ul>
        <li>
<a href="eclipse.html">Eclipse</a>
</li>
        <li>
<a href="netbeans.html">Netbeans</a>
</li>
    </ul>

    <p>Quick Links</p>
<ul>
        <li>
<a href="../index.html">Welcome</a>
</li>

        <li>
<a href="../userGuide/index.html">User and Developer Guides</a>
</li>
    </ul>

<div class="authors">
<p>
<strong>Contributors</strong>
</p>
<ul>
<li>Steve Ditlinger</li>
</ul>
</div>
</div>
<!--end menu-->
<div id="main">

<h1 id="ssl">Secure Socket Layer and Web Applications</h1>
<h2 id="overview">Overview</h2>
<div class="indent">

<p>
Many web applications, especially those deployed for e-commerce, necessitate the
transmission of sensitive data between the web server and the client browser.  This data
may include passwords, credit card numbers, bank account numbers or any other
information that users would not want to divulge to the general public. To protect
sensitive data during transmission, application developers typically use the Secure
Sockets Layer (SSL) and its companion protocol, HTTP over Secure Sockets Layer
(HTTPS). HTTPS employs SSL to protect data by encrypting it at the source, be it the
server or the client, and decrypting it at the destination. This prevents anyone monitoring
Internet data transmissions from easily capturing this data. The client and server
exchange public keys to enable encryption and decryption to occur.
</p>

<p>
The encryption/decryption process comes at a performance price, however. The
throughput of data for a web server transmitting via HTTPS is often as little as one-tenth
that of data transmission via HTTP. For this reason, it is undesirable to deploy an entire
web application under SSL. For fastest performance, it is best to deploy a web
application under HTTP and employ HTTPS only for those pages and processes that
transmit sensitive data.
</p>

</div>
<h2 id="mixing">Mixing Protocols in Web Applications</h2>
<div class="indent">

<p>
Switching back and forth between the two protocols can require hard-coding the protocol
and full URL in every link to each resource in the web application. This creates an
ongoing maintenance headache for developers each time a server name changes or secure
protocol requirements change for resources in the web app.
</p>

<p>
Another significant hazard is that there is nothing to prevent a user from specifying the
wrong protocol by manually entering a URL into the browser. The penalty for manually
specifying HTTPS for a page or servlet that does not require HTTPS is reduced
performance. Far worse is the penalty for manually specifying HTTP for non-secure
access of a page that does require HTTPS: public exposure of sensitive data.
</p>

</div>
<h2 id="help">Help from Deployment Descriptor</h2>
<div class="indent">

<p>
To help overcome the problem of non-secure access of sensitive data, the Java Servlet
Specification (versions 2.2 and 2.3) defines the transport-guarantee element of the
web.xml deployment descriptor file. The transport-guarantee element must specify one
of three types of protection for communication between client and server: NONE,
INTEGRAL, or CONFIDENTIAL. For most containers a specification of INTEGRAL
or CONFIDENTIAL is treated as a requirement for SSL usage. Web application
containers will prevent users from accessing web resources over HTTP if they have been
so specified.
</p>

<p>
The implementation for blocking HTTP access to web resources specified as INTEGRAL
or CONFIDENTIAL varies from container to container. If a user attempts to access such
a resource over HTTP, some containers will present that user with an error message
instructing them to use the HTTPS protocol for accessing the requested resource. Other
containers will actually redirect the request using the HTTPS protocol, but then continue
using the HTTPS protocol for all subsequent requests, even those for resources with a
transport-guarantee specification of NONE.
</p>

</div>
<h2 id="sslext">The sslext Struts Extension</h2>
<div class="indent">

<p>
An extension to Struts 1.1, named sslext, helps solve many of these issues for Struts
developers. It extends the ActionConfig class, RequestProcessor, and Plugin classes to
define a framework where developers may specify the transmission protocol behavior for
Struts applications. Within the Struts configuration file, developers specify which action
requests require HTTPS transmission and which should use HTTP. Developers can also
specify whether to redirect "improperly-protocoled" requests to the correct protocol.
</p>

<p>
In addition to these extensions, the &lt;html:link&gt; and the &lt;html:form&gt; tags have been
extended. In these extensions, the Struts actions specified in either of these tags are
analyzed to determine the protocol that should be used in requesting that action. The
HTML generated by these tags will specify the proper protocol. An additional custom
tag is defined for allowing users to specify the transmission protocol for an individual
JSP. This is most often used for form-based authentication pages.
</p>

<p>
The sslext library may be obtained from <a href="http://sslext.sourceforge.net">
http://sslext.sourceforge.net</a>
</p>

</div>
<h2 id="legacy">Legacy Browser Issue</h2>
<div class="indent">

<p>
One additional complication faced by developers of web applications is that some
browsers (e.g. pre-6.0 versions of Netscape Navigator) will treat requests to different
protocols and ports on the same server as requests to different domains. This causes
these browsers to initiate a new session each time a different protocol or port is specified
in a request. This problem can only be solved at the container level. Some containers
have a "session domain" or "cookie domain" configuration parameter to allow the session
to be shared across different servers in the same domain. As an example, the Weblogic
Server has a "CookieDomain" property configured in its weblogic.xml deployment
descriptor. Thankfully, the effects of this problem are diminishing as people upgrade
their browsers to the current versions.
</p>

</div>
<h2 id="containers">Configuring Containers for SSL</h2>
<div class="indent">

The procedure for configuring SSL for a container will be specific to that container.  The
procedure for enabling SSL for Tomcat can be found
<a href="http://jakarta.apache.org/tomcat/tomcat-4.1-doc/ssl-howto.html">here</a>.

</div>
</div>
<!--end main-->
</div>
<!--end content-->
<div id="footer">
<img id="powered-logo" alt="Powered by Struts" src="../images/struts-power.gif" />
        Copyright (c) 2000-2005, The Apache Software Foundation <span class="noprint">- 
        <a href="http://wiki.apache.org/struts/StrutsDocComments">Comments?</a>
</span>
</div>
<!--end footer-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -