<?xml version="1.0" encoding="Shift_JIS"?>
<!DOCTYPE document [
  <!ENTITY project SYSTEM "project.xml">
]>
<document url="ssl-howto.html">

    &project;

    <properties>
        <author email="ccain@apache.org">Christopher Cain</author>
        <primary><title>SSL Configuration HOW-TO</title></primary>
        <title>SSL設定の手引き</title>
        <translator>小川 環</translator>
        <editor>高橋達男</editor>
    </properties>

<body>


<primary>
<section name="Quick-Start Version">
</section>
</primary>

<section name="簡易スタート版">

<primary>
    <blockquote><em>
    <p>The description below uses the variable name $CATALINA_HOME
    to refer to the directory into which you have installed Tomcat 5,
    and is the base directory against which most relative paths are
    resolved.  However, if you have configured Tomcat 5 for multiple
    instances by setting a CATALINA_BASE directory, you should use
    $CATALINA_BASE instead of $CATALINA_HOME for each of these
    references.</p>
    </em></blockquote>
</primary>

  <blockquote>
    <em>
    <p>
    以下の説明では、Tomcat 5をインストールしたディレクトリを指すために$CATALINA_HOMEという変数名を使用します。
    これは、大半の相対パスを解決していくのに必要となる基底ディレクトリです。
    しかしながら、複数のインスタンスを使用するためにTomcat 5にCATALINA_BASEディレクトリを設定する場合は、
    これらの各々のインスタンスで参照できるよう$CATALINA_HOMEの替わりに$CATALINA_BASEを使用してください。
    </p>
    </em>
  </blockquote>

<primary>
<p>To install and configure SSL support on Tomcat 5, you need to follow
these simple steps.  For more information, read the rest of this HOW-TO.</p>
<ol>
<li>If you are running a 1.3 JVM, download JSSE 1.0.2 (or later) from
   <a href="http://java.sun.com/products/jsse/">http://java.sun.com/products/jsse/</a>
   and either make it an <em>installed extension</em> on the system, or else
   set an environment variable <code>JSSE_HOME</code> that points at the
   directory into which you installed JSSE.  </li><br/><br/>
<li>Create a certificate keystore by executing the following command:
<p>Windows:</p>
<source>
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA
</source>
<p>Unix:</p>
<source>
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
</source>
<p></p>
    and specify a password value of "changeit".</li><br/><br/>
<li>Uncomment the "SSL HTTP/1.1 Connector" entry in
    <code>$CATALINA_HOME/conf/server.xml</code> and tweak as necessary.</li>
    <br/><br/>
</ol>
</primary>

<p>
Tomcat 5にSSL機能をインストールおよび設定するためには、以下の単純なステップに従う必要があります。
詳しい情報については、この手引きの続きをお読みください。
</p>
<ol>
  <li>
    JVM 1.3環境で実行しているケースでは、
    <a href="http://java.sun.com/products/jsse/">http://java.sun.com/products/jsse/</a>
    からJSSE 1.0.2以降を入手してください。
    そして、JVMシステム上の<em>インストール済み拡張ライブラリ</em>にするか、JSSEをインストールしたディレクトリの位置を環境変数JSSE_HOMEに設定してください。
    <annotation>
      <em>インストール済み拡張ライブラリ</em>とは、$JAVA_HOME/jre/lib/extディレクトリ配下に格納されたライブラリを示します。
    </annotation>
    <note>"installed extension"というのは、JREのインストールディレクトリの
    lib/ext ディレクトリを指しているっぽいので、「インストール済拡張ライブラリ」
    としてみました。</note>
  </li><br/><br/>
  <li>
    下記に示すコマンドを実行し、証明書のキーストアを生成してください。
    <p>Windows:</p>
<source>
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA
</source>
    <p>Unix:</p>
<source>
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
</source>
    <p></p>
    そして、パスワードに"changeit"という値を指定してください。
  </li><br/><br/>
  <li>
    <code>$CATALINA_HOME/conf/server.xml</code>にある"SSL Coyote HTTP/1.1 Connector"欄のコメントを外し、必要に応じて設定内容を調整してください。
    <note>
      "SSL HTTP/1.1 Connector"(誤) → "SSL Coyote HTTP/1.1 Connector"(正) ？
    </note>
  </li><br/><br/>
</ol>

</section>


<primary>
<section name="Introduction to SSL">
</section>
</primary>

<section name="SSL入門">

<primary>
<p>SSL, or Secure Socket Layer, is a technology which allows web browsers and
web servers to communicate over a secured connection.  This means that the data
being sent is encrypted by one side, transmitted, then decrypted by the other
side before processing.  This is a two-way process, meaning that both the
server AND the browser encrypt all traffic before sending out data.</p>
</primary>
<p>
SSL(Secure Socket Layer)とは、WebブラウザとWebサーバ間でセキュアな接続の元で通信を行えるようにする技術です。
つまり、送信されるデータが片方で暗号化されて送信され、その後、処理に入る前にもう片方で復号化されます。
これは、双方向プロセスであり、データを送信する前に、サーバおよびブラウザがすべてのやり取りを暗号化することを意味します。
</p>

<primary>
<p>Another important aspect of the SSL protocol is Authentication.  This means
that during your initial attempt to communicate with a web server over a secure
connection, that server will present your web browser with a set of
credentials, in the form of a "Certificate", as proof the site is who and what
it claims to be.  In certain cases, the server may also request a Certificate
from your web browser, asking for proof that <em>you</em> are who you claim
to be.  This is known as "Client Authentication," although in practice this is
used more for business-to-business (B2B) transactions than with individual
users.  Most SSL-enabled web servers do not request Client Authentication.</p>
</primary>
<p>
SSLプロトコルでもう一つ重要なのは、認証です。
つまり、セキュアな接続上でWebサーバと最初に通信を試みる間に、当該サーバは、"証明書"という形式で、誰の、何のサイトであるのかを示す証拠として、証明に必要なもの一式をWebブラウザに提示します。
また、あるケースでは、サーバ側が、<em>あなた</em>が誰なのかを示す証明として、Webブラウザに証明書を要求することもあります。
これは"クライアント認証"として知られていますが、実際には個人ユーザよりも、企業間電子商取引(B2B)においてより多く使われます。
SSL化されているWebサーバのほとんどは、クライアント認証を要求しません。
<note>
  secure connectionの訳を「安全な接続」にしましたが「セキュア接続」にした方がいいでしょうか？<br/>
  「セキュア(な)」に統一しました。
</note>
</p>

</section>

<primary>
<section name="SSL and Tomcat">
</section>
</primary>

<section name="SSLとTomcat">

<primary>
<p>It is important to note that configuring Tomcat to take advantage of
secure sockets is usually only necessary when running it as a stand-alone
web server.  When running Tomcat primarily as a Servlet/JSP container behind
another web server, such as Apache or Microsoft IIS, it is usually necessary
to configure the primary web server to handle the SSL connections from users.
Typically, this server will negotiate all SSL-related functionality, then
pass on any requests destined for the Tomcat container only after decrypting
those requests.  Likewise, Tomcat will return cleartext responses, that will
be encrypted before being returned to the user's browser.  In this environment,
Tomcat knows that communications between the primary web server and the
client are taking place over a secure connection (because your application
needs to be able to ask about this), but it does not participate in the
encryption or decryption itself.</p>
</primary>

<p>
セキュアソケットを利用できるようにTomcatを設定する必要があるのは、ほとんどがスタンドアローンWebサーバとして実行する場合だけであることに注意して下さい。
ApacheやMicrosoft IISといった他のWebサーバの後方のサーブレット/JSPコンテナとしてTomcatを使う場合、通常はプライマリWebサーバで、
ユーザからのSSL接続をハンドリングするように設定する必要があります。
一般に、こうしたサーバはSSL関連の機能のネゴシエーションを全て行い、Tomcatコンテナで処理させたいリクエストは復号化した後にTomcatに転送します。
同様に、Tomcatは平文のレスポンスを返し、ユーザのブラウザに返される前に暗号化されます。
このような環境において、TomcatはプライマリWebサーバとクライアントの間での通信がセキュアな接続の元で行われていることを認識しています
(アプリケーションがこのことを確認できる必要があるためです)が、暗号化もしくは復号化処理自体に関与することはありません。
</p>

</section>

<primary>
<section name="Certificates">
</section>
</primary>

<section name="証明書">

<primary>
<p>In order to implement SSL, a web server must have an associated Certificate
for each external interface (IP address) that accepts secure connections.
The theory behind this design is that a server should provide some kind of
reasonable assurance that its owner is who you think it is, particularly
before receiving any sensitive information.  While a broader explanation of
Certificates is beyond the scope of this document, think of a Certificate
as a "digital driver's license" for an Internet address.  It states what
company the site is associated with, along with some basic contact
information about the site owner or administrator.</p>
</primary>
<p>
SSLを実装するためには、Webサーバはセキュアな接続を受け付ける各外部インターフェース(IPアドレス)ごとに証明書を用意しなければなりません。
「特に機密性の高い情報を受信する前には、サーバの所有者はユーザが想定している者であるという一種の正当な保証をサーバは提供すべき」という理論がこうした設計の背景にあります。
証明書に関するさらに一般的な説明はこのドキュメントの範囲外となりますが、証明書はインターネットアドレスの"デジタル運転免許証"のようなものと考えてください。
サイトの所有者または管理者の基本的な連絡先とともに、そのサイトがどの企業に関連しているかが証明書には記述されています。
</p>

<primary>
<p>This "driver's license" is cryptographically signed by its owner, and is
therefore extremely difficult for anyone else to forge.  For sites involved
in e-commerce, or any other business transaction in which authentication of
identity is important, a Certificate is typically purchased from a well-known
<em>Certificate Authority</em> (CA) such as VeriSign or Thawte.  Such
certificates can be electronically verified -- in effect, the Certificate
Authority will vouch for the authenticity of the certificates that it grants,
so you can believe that that Certificate is valid if you trust the Certificate
Authority that granted it.</p>
</primary>
<p>
この"運転免許証"は、その所有者によって暗号化された状態で署名されています。
したがって、他人が偽造することはきわめて困難です。E-コマースなど、身元の認証が重要となる商取引に関わるサイトでは、証明書は一般的にVeriSignやThawteといった有名な<em>認証局</em>(CA)より購入されます。
こうした証明書は電子的な証明が可能です -- つまり、認証局は発行した証明書の正当性を保証します。したがって、証明書を発行した認証局を信用すれば、証明書が有効であると信頼できるのです。
</p>

<primary>
<p>In many cases, however, authentication is not really a concern.  An
administrator may simply want to ensure that the data being transmitted and
received by the server is private and cannot be snooped by anyone who may be
eavesdropping on the connection.  Fortunately, Java provides a relatively
simple command-line tool, called <code>keytool</code>, which can easily create
a "self-signed" Certificate.  Self-signed Certificates are simply user
generated Certificates which have not been officially registered with any
well-known CA, and are therefore not really guaranteed to be authentic at all.
Again, this may or may not even be important, depending on your needs.</p>
</primary>
<p>
しかしながら多くのケースでは、実際に重要なのは認証ではありません。管理者は単に、サーバによって送受信されているデータが外部に漏れないことや、接続に対して盗聴を試みる者が詮索できないことを保証したいと思っているだけかもしれません。
幸運にもJavaでは、"自己署名"証明書を簡単に生成可能な、<code>keytool</code>と呼ばれる比較的シンプルなコマンドラインツールを提供しています。
自己署名証明書はユーザが生成した証明書に過ぎず、有名な認証局より公式に発行されたわけではないので、実際には本物の証明書であることを少しも保証しません。
繰り返しますが、このことが重要かどうかは、あなたの要求次第です。
</p>

</section>

<primary>
<section name="General Tips on Running SSL">
</section>
</primary>

<section name="SSLを動かす上での一般的なヒント">

<primary>
<p>The first time a user attempts to access a secured page on your site,
he or she is typically presented with a dialog containing the details of
the certificate (such as the company and contact name), and asked if he or she
wishes to accept the Certificate as valid and continue with the transaction.
Some browsers will provide an option for permanently accepting a given
Certificate as valid, in which case the user will not be bothered with a
prompt each time they visit your site.  Other browsers do not provide this
option.  Once approved by the user, a Certificate will be considered valid
for at least the entire browser session.</p>
</primary>
<p>
ユーザがあなたのサイト上のセキュアなページへ初めてアクセスしようとすると、通常は(企業名や連絡先といった)証明書の詳細を含むダイアログを表示し、証明書を有効であると受け入れて処理を続行してよいかどうか確認を求めます。
すでに有効となっている証明書を半永久的に受け入れるオプションを提供しているブラウザもあり、その場合は、サイトへ訪問するたびにプロンプトが表示されることはありません。
このオプションが提供されないブラウザもあります。いったんユーザが承認すれば、少なくともブラウザのセッションが維持される間は証明書は有効だと考えていいでしょう。
</p>

<primary>
<p>Also, while the SSL protocol was designed to be as efficient as securely
possible, encryption/decryption is a computationally expensive process from
a performance standpoint.  It is not strictly necessary to run an entire
web application over SSL, and indeed a developer can pick and choose which
pages require a secure connection and which do not.  For a reasonably busy
site, it is customary to only run certain pages under SSL, namely those
pages where sensitive information could possibly be exchanged.  This would
include things like login pages, personal information pages, and shopping
cart checkouts, where credit card information could possibly be transmitted.
Any page within an application can be requested over a secure socket by
simply prefixing the address with <code>https:</code> instead of
<code>http:</code>.  Any pages which absolutely <strong>require</strong>
a secure connection should check the protocol type associated with the
page request and take the appropriate action of <code>https</code> is not
specified.</p>
</primary>
<p>
また、SSLプロトコルが安全性と効率性の両面を可能な限り意識して設計されているとは言っても、暗号化/復号化は、パフォーマンスという観点では演算のコストが高いプロセスです。
厳密に言うと、Webアプリケーション全体にSSLを張り巡らした状態で稼動する必要はなく、実際には、各ページで開発者がセキュアな接続を要するかどうかを選定して決定することができます。
かなり負荷の高いサイトでは、重要なページ、すなわち機密情報をやり取りする可能性のあるページのみをSSLの元で動かすのが一般的です。
これには、ログインページや個人情報を扱うページ、クレジットカード情報を送信する可能性のあるショッピングカートの精算手続といったものも含まれるでしょう。
<note>
  ショッピングカートで勘定を行う場合、事前にカード情報を登録していれば、必ずしもカード情報を送らないかもしれません。
</note>
<code>http:</code>の代わりに<code>https:</code>をアドレスの先頭につけることにより、アプリケーションのどのページでもセキュアソケット上でリクエスト処理を行えます。
セキュアな接続を絶対に<strong>必要とする</strong>ページはいかなるものでも、ページのリクエストに関連するプロトコル形式をチェックし、<code>https</code>が指定されていない場合は適宜対策を講ずるべきです。
</p>

<primary>
<p>Finally, using name-based virtual hosts on a secured connection can be
problematic.  This is a design limitation of the SSL protocol itself.  The SSL
handshake, where the client browser accepts the server certificate, must occur
before the HTTP request is accessed.  As a result, the request information
containing the virtual host name cannot be determined prior to authentication,
and it is therefore not possible to assign multiple certificates to a single
IP address.  If all virtual hosts on a single IP address need to authenticate
against the same certificate, the addition of multiple virtual hosts should not
interfere with normal SSL operations on the server.  Be aware, however, that
most client browsers will compare the server's domain name against the domain
name listed in the certificate, if any (applicable primarily to official,
CA-signed certificates).  If the domain names do not match, these browsers will
display a warning to the client user.  In general, only address-based virtual
hosts are commonly used with SSL in a production environment.</p>
</primary>
<p>
最後に、セキュアな接続の元で名前ベースの仮想ホストを使用することは問題があるかもしれません。
これは、SSLプロトコル自身の持つ設計上の制限です。
クライアントブラウザがサーバ証明書を受け付けるSSLのハンドシェイクは、HTTPリクエストがアクセスされる前に行われなければなりません。結果として、
仮想ホスト名を含むリクエスト情報は認証処理に先立って決定できず、したがって、単一IPアドレスに対して複数の証明書を割り当てることは不可能です。
単一IPアドレス上のすべての仮想ホストが同一の証明書で認証しなければならない場合は、仮想ホストを複数追加してもサーバ上のSSLオペレーションを妨げはしないはずです。
しかしほとんどのクライアントブラウザは、証明書にドメイン名が載っていればそれとサーバのドメイン名とを比較することに留意して下さい(まずは公式かつ認証局で署名された証明書に対して適用されます)。
ドメイン名が合致しなければ、こうしたブラウザはクライアントユーザに警告を表示します。
一般的には、稼働環境でSSLとともに使用されるのは、アドレスベースの仮想ホストだけであるのが通例です。
<note>
  "In general" と "commonly" が両方出てくるのは、
「馬から落馬する」みたいでなんか変ではありますが・・・。
</note>
<note>
  "if any"の"any"はdomain listと解釈していますが、certificateの可能性もあるかと思っています。<br/>
  "any"の対象を"server domain names"(サーバドメイン名)に修正しました。
</note>
</p>

</section>

<primary>
<section name="Configuration">
</section>
</primary>
<section name="設定">

<primary>
<subsection name="Download and Install JSSE">
</subsection>
</primary>
<subsection name="JSSEの入手とインストール">
<a name="Download and Install JSSE"/>
<primary>
<p>Download the <em>Java Secure Socket Extensions</em> (JSSE) package,
version 1.0.2 or later, from
<a href="http://java.sun.com/products/jsse/">http://java.sun.com/products/jsse/</a>.
If you built Tomcat from source, you have probably already downloaded this
package.  If you are running JDK 1.4 (currently in beta), these classes have
been integrated directly into the JDK, so you can skip this entire step.</p>
</primary>
<p>
<em>Java Secure Socket Extensions</em> (JSSE) パッケージのバージョン1.0.2以降を
<a href="http://java.sun.com/products/jsse/">http://java.sun.com/products/jsse/</a>
よりダウンロードしてください。Tomcatをソースコードから構築する場合、
このパッケージはすでにダウンロード済となっていることでしょう。
JDK 1.4上で動かすのであれば、これらのクラスはJDKに組み込まれているため、この作業ステップを飛ばしても構いません。
<note>
  JDK 1.4の括弧書き"(currently in beta)"の部分はもう不要？
</note>
</p>

<primary>
<p>After expanding the package, there are two ways to make it available to
Tomcat (choose one or the other):</p>
<ul>
<li>Make JSSE an <em>installed extension</em> by copying all three JAR files
    (<code>jcert.jar</code>, <code>jnet.jar</code>, and <code>jsse.jar</code>)
    into your <code>$JAVA_HOME/jre/lib/ext</code> directory.</li>
<li>Create a new environment variable <code>JSSE_HOME</code> that contains
    the absolute path to the directory into which you unpacked the
    JSSE binary distribution.</li>
</ul>
</primary>
<p>
パッケージを展開した後、Tomcatでそれを利用するための手順は2通りあります(どちらか一つを選択してください)。
<ul>
  <li>
    <code>$JAVA_HOME/jre/lib/ext</code>ディレクトリに、
    ３つのJARファイル(<code>jcert.jar</code>、<code>jnet.jar</code>、<code>jsse.jar</code>)をすべてコピーしてJSSEを<em>インストール済拡張ライブラリ</em>にする。
  </li>
  <li>
    JSSEバイナリディストリビューションを展開したディレクトリの絶対パスが設定された<code>JSSE_HOME</code>環境変数を作成する。
  </li>
</ul>
</p>

</subsection>

<primary>
<subsection name="Prepare the Certificate Keystore">
</subsection>
</primary>
<subsection name="証明書のキーストアを用意する">
<a name="Prepare the Certificate Keystore"/>
<primary>
<p>Tomcat currently operates only on <code>JKS</code> format keystores.  This
is Java's standard "Java KeyStore" format, and is the format created by the
<code>keytool</code> command-line utility.  This tool is included in the JDK.
</p>
</primary>
<p>
現在、Tomcatでは<code>JKS</code>フォーマットのキーストアしか扱えません。
これはJava標準の"Java KeyStore"フォーマットであり、<code>keytool</code>コマンドラインユーティリティで生成されるフォーマットです。
このツールはJDKに同梱されています。
</p>

<primary>
<p>To import an existing certificate into a JKS keystore, please read the
documentation (in your JDK documentation package) about <code>keytool</code>.
</p>
</primary>
<p>
JKSキーストアに既存の証明書をインポートするためには、(JDKドキュメントパッケージにある)<code>keytool</code>のドキュメントをお読みください。
</p>

<primary>
<p>To create a new keystore from scratch, containing a single self-signed
Certificate, execute the following from a terminal command line:</p>
<p>Windows:</p>
<source>
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA
</source>
<p>Unix:</p>
<source>
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
</source>
</primary>
<p>
単独の自己署名証明書を含め、キーストアを一から新しく生成するには、
端末のコマンドライン上で下記のコマンドを実行してください。
</p>
<p>Windows:</p>
<source>
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA
</source>
<p>Unix:</p>
<source>
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
</source>

<primary>
<p>(The RSA algorithm should be preferred as a secure algorithm, and this
also ensures general compatibility with other servers and components.)</p>
</primary>
<p>
(安全性の高いアルゴリズムとしてはRSAアルゴリズムが望ましく、
これは他のサーバやコンポーネントとの全般的な互換性も確保しています。)
</p>

<primary>
<p>This command will create a new file, in the home directory of the user
under which you run it, named "<code>.keystore</code>".  To specify a
different location or filename, add the <code>-keystore</code> parameter,
followed by the complete pathname to your keystore file,
to the <code>keytool</code> command shown above.  You will also need to
reflect this new location in the <code>server.xml</code> configuration file,
as described later.  For example:</p>
<p>Windows:</p>
<source>
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \
  -keystore \path\to\my\keystore
</source>
<p>Unix:</p>
<source>
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA \
  -keystore /path/to/my/keystore
</source>
</primary>
<p>
このコマンドで、実行ユーザのホームディレクトリ上に、<code>.keystore</code>という名前のファイルが新しく生成されます。
違う場所やファイル名を指定する場合には、上述の<code>keytool</code>コマンドに対し、<code>-keystore</code>パラメータと、
キーストアファイルの完全なパス名をつけてください。
また後述するように、<code>server.xml</code>設定ファイルにこの新しい場所を反映させる必要があります。<br/>
例:
</p>
<p>Windows:</p>
<source>
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA \
  -keystore \path\to\my\keystore
</source>
<p>Unix:</p>
<source>
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA \
  -keystore /path/to/my/keystore
</source>

<primary>
<p>After executing this command, you will first be prompted for the keystore
password.  The default password used by Tomcat is "<code>changeit</code>"
(all lower case), although you can specify a custom password if you like.
You will also need to specify the custom password in the
<code>server.xml</code> configuration file, as described later.</p>
</primary>
<p>
このコマンドの実行の際、最初にキーストアのパスワードを入力するように促されます。
Tomcatで使用するデフォルトパスワードは"<code>changeit</code>"(すべて小文字)ですが、必要ならば独自のパスワードを指定することも可能です。
</p>

<primary>
<p>Next, you will be prompted for general information about this Certificate,
such as company, contact name, and so on.  This information will be displayed
to users who attempt to access a secure page in your application, so make
sure that the information provided here matches what they will expect.</p>
</primary>
<p>
次に、企業名や連絡先など、証明書に関する全般的な情報を入力するように促されます。
アプリケーションにあるセキュアなページにアクセスしようとしたユーザに対してこの情報は表示され、ここに提示された情報がユーザの期待している情報と合致しているのかどうかを確認できます。
</p>

<primary>
<p>Finally, you will be prompted for the <em>key password</em>, which is the
password specifically for this Certificate (as opposed to any other
Certificates stored in the same keystore file).  You <strong>MUST</strong>
use the same password here as was used for the keystore password itself.
(Currently, the <code>keytool</code> prompt will tell you that pressing the
ENTER key does this for you automatically.)</p>
</primary>
<p>
最後に、(同じキーストアファイルに格納された他の証明書とは対照的に)
この証明書専用のパスワードである<em>キーパスワード</em>を入力するように促されます。
ここでは、キーストアのパスワード自体に使用されるのと同じパスワードを使用<strong>しなければなりません</strong>。
(現在、ENTERキーを押下するとこれを自動的に行うことが<code>keytool</code>プロンプトにてユーザに表示されます。)
</p>

<primary>
<p>If everything was successful, you now have a keystore file with a
Certificate that can be used by your server.</p>
</primary>
<p>
すべてうまくいけば、サーバで使用できる証明書を含んだキーストアファイルの完成です。
</p>

</subsection>

<primary>
<subsection name="Edit the Tomcat Configuration File">
</subsection>
</primary>
<subsection name="Tomcatの設定ファイルを編集する">
<a name="Edit the Tomcat Configuration File"/>
<primary>
<p>The final step is to configure your secure socket in the
<code>$CATALINA_HOME/conf/server.xml</code> file, where
<code>$CATALINA_HOME</code> represents the directory into which you
installed Tomcat 5.  An example <code>&lt;Connector&gt;</code> element
for an SSL connector is included in the default <code>server.xml</code>
file installed with Tomcat.  It will look something like this:</p>
<source>
&lt;-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --&gt;
&lt;!--
&lt;Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
           port="8443" minProcessors="5" maxProcessors="75"
           enableLookups="true" disableUploadTimeout="true"
           acceptCount="100" debug="0" scheme="https" secure="true";
           clientAuth="false" sslprotocol="TLS"/&gt;
--&gt;
</source>
</primary>
<p>
最後のステップは、<code>$CATALINA_HOME/conf/server.xml</code>
にあるセキュアソケット定義の設定です。
<code>$CATALINA_HOME</code>は、Tomcatをインストールしたディレクトリを示します。
SSLコネクタを宣言した<code>&lt;Connector&gt;</code>要素のサンプルは、Tomcatにインストールされているデフォルトの<code>server.xml</code>ファイルに含まれています。その部分にはこのように記述されています。
</p>
<source>
&lt;-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 --&gt;
&lt;!--
&lt;Connector className="org.apache.coyote.tomcat5.CoyoteConnector"
           port="8443" minProcessors="5" maxProcessors="75"
           enableLookups="true" disableUploadTimeout="true"
           acceptCount="100" debug="0" scheme="https" secure="true";
           clientAuth="false" sslprotocol="TLS"/&gt;
--&gt;
</source>

<primary>
<p>You will note that the Connector element itself is commented out by default,
so you will need to remove the comment tags around it.  Then, you can
customize the specified attributes as necessary.  For detailed information
about the various options, consult the
<a href="config/index.html">Server Configuration Reference</a>.  The
following discussion covers only those attributes of most interest when
setting up SSL communication.</p>
</primary>
<p>
Connector要素自体がデフォルトではコメントアウトされているので、それを囲んでいるコメントタグを外す必要があることに注意して下さい。
その後、必要に応じて指定された属性をカスタマイズできます。
各オプションの詳しい情報については、<a href="config/index.html">サーバ設定リファレンス</a>を調べてください。
下記の説明では、SSL通信のセットアップで最も重要な属性のみを取り上げています。
</p>

<primary>
<p>The <code>port</code> attribute (default value is 8443) is the TCP/IP
port number on which Tomcat will listen for secure connections.  You can
change this to any port number you wish (such as to the default port for
<code>https</code> communications, which is 443).  However, special setup
(outside the scope of this document) is necessary to run Tomcat on port
numbers lower than 1024 on many operating systems.</p>
</primary>
<p>
<code>port</code>属性は、Tomcatがセキュアな接続を待ち受けるTCP/IPポート番号です(デフォルト値は8443)。
これを(<code>https</code>のデフォルトポートである443といった)任意のポート番号に変更することができます。
しかしながら多くのオペレーティングシステムでは、Tomcatを1024未満のポート番号で動かすには特別なセットアップ(本ドキュメントの範囲外になります)が必要になります。
</p>

<primary>
  <blockquote><em>
  <p>If you change the port number here, you should also change the
  value specified for the <code>redirectPort</code> attribute on the
  non-SSL connector.  This allows Tomcat to automatically redirect
  users who attempt to access a page with a security constraint specifying
  that SSL is required, as required by the Servlet 2.4 Specification.</p>
  </em></blockquote>
</primary>
  <blockquote><em>
  <p>
  ここでポート番号を変更する場合、非SSLコネクタ上の<code>redirectPort</code>属性の設定値も変更すべきです。これによってTomcatは、
  サーブレット2.4仕様で要求されているように、SSLを要するセキュリティ制約の指定を含んだページへアクセスしようとするユーザを自動的にリダイレクトできるようになります。
  </p>
  </em></blockquote>

<primary>
<p>There are addional option used to configure the SSL protocol.
  You may need to add or change the following attribute
values, depending on how you configured your keystore earlier:</p>
</primary>
<p>
SSLプロトコルの設定に使用される追加オプションを示します。
先述したキーストアの設定方法によっては、下記の属性値を追加もしくは変更する必要があるかもしれません。
</p>

<primary>
<table border="1">
  <tr>
    <th>Attribute</th>
    <th>Description</th>
  </tr>
  <tr>
    <td><code>clientAuth</code></td>
    <td>Set this value to <code>true</code> if you want Tomcat to require
        all SSL clients to present a client Certificate in order to use
        this socket.</td>
  </tr>
  <tr>
    <td><code>keystoreFile</code></td>
    <td>Add this attribute if the keystore file you created is not in
        the default place that Tomcat expects (a file named
        <code>.keystore</code> in the user home directory under
        which Tomcat is running).  You can specify an absolute pathname,
        or a relative pathname that is resolved against the
        <code>$CATALINA_BASE</code> environment variable.</td>
  </tr>
  <tr>
    <td><code>keystorePass</code></td>
    <td>Add this element if you used a different keystore (and Certificate)
        password than the one Tomcat expects (<code>changeit</code>).</td>
  </tr>
  <tr>
    <td><code>sslProtocol</code></td>
    <td>The encryption/decryption protocol to be used on this socket.
        Do not change the default value.</td>
  </tr>
  <tr>
    <td><code>ciphers</code></td>
    <td>The comma separated list of encryption ciphers that this socket is 
        allowed to use.  By default, any available cipher is allowed.</td>
  </tr>
</table>
</primary>

<table border="1">
  <tr>
    <th>属性</th>
    <th>説明</th>
  </tr>
  <tr>
    <td><code>clientAuth</code></td>
    <td>
      このソケットを使用するために、TomcatがすべてのSSLクライアントにクライアント証明書の提示を求めたい場合、<code>true</code>を設定してください。
    </td>
  </tr>
  <tr>
    <td><code>keystoreFile</code></td>
    <td>
      作成したキーストアファイルがTomcatが想定しているデフォルトの場所(Tomcatの実行ユーザのホームディレクトリ上で、ファイル名が<code>.keystore</code>)にない場合、この属性を追加してください。
      絶対パス名もしくは<code>$CATALINA_BASE</code>環境変数を元に解決される相対パス名を指定することができます。
    </td>
  </tr>
  <tr>
    <td><code>keystorePass</code></td>
    <td>
      Tomcatが想定するパスワード(<code>changeit</code>)と異なるキーストア(および証明書)のパスワードを使用する場合に、この属性を追加してください。
    </td>
  </tr>
  <tr>
    <td><code>sslProtocol</code></td>
    <td>
      このソケットで使用される暗号化/復号化プロトコル。
      デフォルト値をそのまま使用してください。
    </td>
  </tr>
  <tr>
    <td><code>ciphers</code></td>
    <td>
      このソケットが使用を許可する暗号化方式をカンマで区切った一覧。
      デフォルトでは、利用可能な暗号化方式をすべて許可しています。
    </td>
  </tr>
</table>

<primary>
<p>After completing these configuration changes, you must restart Tomcat as
you normally do, and you should be in business.  You should be able to access
any web application supported by Tomcat via SSL.  For example, try:</p>
<source>
https://localhost:8443
</source>
</primary>
<p>
これらの設定変更を完了した後、いつものようにTomcatを再起動する必要があり、再起動すれば設定が反映されるはずです。
TomcatでサポートするあらゆるWebアプリケーションにSSL経由でアクセス可能になっているはずです。
例えば、次のように試してください。
</p>
<source>
https://localhost:8443
</source>

<primary>
<p>and you should see the usual Tomcat splash page (unless you have modified
the ROOT web application).  If this does not work, the following section
contains some troubleshooting tips.</p>
</primary>
<p>
さらに、(Webアプリケーション"ROOT"を修正していない限り)いつもの派手なTomcatのページが表示されるはずです。
うまく動かない場合は、後の方に出てくる、トラブルシューティングに関するヒントをいくつか紹介しているセクションを参照してください。
</p>

</subsection>

</section>

<primary>
<section name="Installing a Certificate from a Certificate Authority"/>
</primary>
<section name="認証局から発行される証明書をインストールする">
<primary>
<p>To obstain and install a Certificate from a Certificate Authority (like verisign.com, thawte.com 
or trustcenter.de) you should have read the previous section and then follow these instructions:</p>
</primary>
<p>
認証局(verisign.com、thawte.com、trustcenter.deなど)から発行される証明書を取得・インストールするには、前の方のセクションをお読みの上、下記に示す手順に従ってください。
<note>
  "obstain"(誤) → "obtain"(正) ？
</note>
</p>
<primary>
<subsection name="Create a local Certificate Signing Request (CSR)"/>
</primary>
<subsection name="ローカル向けの証明書署名要求(CSR)を生成する">
<primary>
<p>In order to obtain a Certificate from the Certificate Authority of your choice 
you have to create a so called Certificate Signing Request (CSR). That CSR will be used 
by the Certificate Authority to create a Certificate that will identify your website 
as "secure". To create a CSR follow these steps:</p>
</primary>
<p>
あなたの選んだ認証局から証明書を取得するには、いわゆる「証明書署名要求(CSR)」を生成する必要があります。
この証明書署名要求(CSR)は、認証局が、あなたのWebサイトが"セキュア"であることを確認する証明書を発行するのに使用されます。
以下の手順に従って、証明書署名要求(CSR)を生成してください。
</p>
<primary>
<ul>
<li>Create a local Certificate (as described in the previous section):
	<source>keytool -genkey -alias tomcat -keyalg RSA \
	-keystore &lt;your_keystore_filename&gt;</source>
	Note: In some cases you will have to enter the domain of your website (i.e. <code>www.myside.org</code>)
	in the field "first- and lastname" in order to create a working Certificate. 
</li>
<li>The CSR is then created with:
	<source>keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr \
	-keystore &lt;your_keystore_filename&gt;</source>
</li>
</ul>
</primary>
<ul>
  <li>
    (前のセクションで説明したように)ローカル向けの証明書を生成してください。
    <source>keytool -genkey -alias tomcat -keyalg RSA \
    -keystore &lt;your_keystore_filename&gt;</source>
    注意: 場合によっては、正しく動作する証明書を生成するのに、"姓名"項目にWebサイトのドメイン(例.<code>www.myside.org</code>)を入力する必要があるかもしれません。
    <note>
      日本語環境でkeytoolを実行した場合、"first- and lastname"は「姓名を入力してください。」となっています。
    </note>
  </li>
  <li>
    次に、以下のコマンドで証明書署名要求(CSR)を生成します。
    <source>keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr \
    -keystore &lt;your_keystore_filename&gt;</source>
  </li>
</ul>
<primary>
<p>Now you have a file called <code>certreq.csr</code> that you can submit to the Certificate Authority (look at the
documenation of the Certificate Authority website on how to do this). In return you get a Certificate.</p>
</primary>
<p>
これで認証局に申請可能な<code>certreq.csr</code>というファイルができます(申請手順については認証局のWebサイトのドキュメントをご覧下さい)。
提出されたものを元に、証明書が発行されます。
<note>
  documetation(誤)→documentation(正)
</note>
</p>
</subsection>

<primary>
<subsection name="Importing the Certificate"/>
</primary>
<subsection name="証明書をインポートする">
<primary>
<p>Now that you have your Certificate you can import it into you local keystore. 
First of all you have to import a so called Chain Certificate or Root Certificate into your keystore. 
After that you can procede with importing your Certificate.</p>
</primary>
<p>
これで証明書ができたので、ローカルのキーストアにインポートできます。まず始めに、いわゆる「チェーン証明書」または「ルート証明書」をキーストアにインポートしてください。
その上で、手元にある証明書のインポートを行います。
<note>
  "you local keystore"(誤) → "your local keystore"(正) ？
</note>
<note>
  "procede"(誤) → "proceed"(正) ？
</note>
<note>
  "Chain Certificate"は「証明書チェーン」という表現が一般的？<br/>
  「証明書チェーン」はルート証明書に辿る連鎖情報を示し、証明書自体を特に意味していない。<br/>
  例えば、日本では、セコムトラストネット社で「Entrustチェーン証明書」を発行している。
</note>
</p>

<primary>
<ul>
<li>Download a Chain Certificate from the Certificate Authority you obtained the Certificate from.<br/>
	For Verisign.com go to: http://www.verisign.com/support/install/intermediate.html<br/>
	For Trustcenter.de go to: http://www.trustcenter.de/certservices/cacerts/en/en.htm#server<br/>
	For Thawte.com go to: http://www.thawte.com/certs/trustmap.html<br/>
</li>
<li>Import the Chain Certificate into you keystore
    <source>keytool -import -alias root -keystore &lt;your_keystore_filename&gt; \
	-trustcacerts -file &lt;filename_of_the_chain_certificate&gt;</source>
</li>
<li>And finally import your new Certificate
	<source>keytool -import -alias tomcat -keystore &lt;your_keystore_filename&gt; \
	-trustcacerts -file &lt;your_certificate_filename&gt;</source>
</li>
</ul>
</primary>
<ul>
  <li>
    証明書を取得した認証局よりチェーン証明書をダウンロードしてください。<br/>
    Verisign.com: http://www.verisign.com/support/install/intermediate.html<br/>
    Trustcenter.de: http://www.trustcenter.de/certservices/cacerts/en/en.htm#server<br/>
    Thawte.com: http://www.thawte.com/certs/trustmap.html<br/>
    <note>
      ここのURLにハイパーリンクがないのは何か意味があるのでしょうか…？<br/>
      特に意味はないと思うのですが、一応このままにしておきます。
    </note>
  </li>
  <li>
    チェーン証明書をキーストアにインポートしてください。
    <source>keytool -import -alias root -keystore &lt;your_keystore_filename&gt; \
    -trustcacerts -file &lt;filename_of_the_chain_certificate&gt;</source>
  </li>
  <li>
    そして最後に、新規発行された証明書をインポートしてください。
    <source>keytool -import -alias tomcat -keystore &lt;your_keystore_filename&gt; \
     -trustcacerts -file &lt;your_certificate_filename&gt;</source>
  </li>
</ul>
</subsection>
</section>

<primary>
<section name="Troubleshooting"/>
</primary>
<section name="トラブルシューティング">

<primary>
<p>Here is a list of common problems that you may encounter when setting up
SSL communications, and what to do about them.</p>
</primary>
<p>
SSL通信のセットアップ時に遭遇する問題や対処法の一覧を以下に示します。
</p>
<ul>

<primary>
  <li>I get "java.security.NoSuchAlgorithmException" errors in my
    log files.
    <blockquote>
    <p>The JVM cannot find the JSSE JAR files.  Follow all of the directions to
    <a href="#Download and Install JSSE">download and install JSSE</a>.</p>
    </blockquote></li>
</primary>
  <li>
    ログファイルで"java.security.NoSuchAlgorithmException"が表示される。
    <blockquote>
    <p>
    JVMが、JSSEのJARファイルを見つけられません。
    <a href="#Download and Install JSSE">JSSEの入手とインストール</a>の説明文をお読みください。
    </p>
    </blockquote>
  </li>

<primary>
<li>When Tomcat starts up, I get an exception like
    "java.io.FileNotFoundException: {some-directory}/{some-file} not found".
    <blockquote>
    <p>A likely explanation is that Tomcat cannot find the keystore file
    where it is looking.  By default, Tomcat expects the keystore file to
    be named <code>.keystore</code> in the user home directory under which
    Tomcat is running (which may or may not be the same as yours :-).  If
    the keystore file is anywhere else, you will need to add a
    <code>keystoreFile</code> attribute to the <code>&lt;Factory&gt;</code>
    element in the <a href="#Edit the Tomcat Configuration File">Tomcat
    configuration file</a>.</p>
    </blockquote></li>
</primary>
  <li>
    Tomcatの起動時に、"java.io.FileNotFoundException:
    {some-directory}/{some-file} not found"のような例外が返される。
    <blockquote>
    <p>
    おそらく、参照するキーストアファイルをTomcatが見つけられないのでしょう。
    デフォルトでは、(あなたと同じ環境であるかどうかに関係なく)Tomcatの実行ユーザのホームディレクトリ上にある<code>.keystore</code>という名前のファイルが存在していることをTomcat側は想定しています。
    キーストアファイルがどこか他にあるのなら、<a href="#Edit the Tomcat Configuration File">Tomcatの設定ファイル</a>の<code>&lt;Factory&gt;</code>要素に<code>keystoreFile</code>属性を追加設定しないといけません。
    </p>
    </blockquote>
  </li>

<primary>
<li>When Tomcat starts up, I get an exception like
    "java.io.FileNotFoundException:  Keystore was tampered with, or
    password was incorrect".
    <blockquote>
    <p>Assuming that someone has not <em>actually</em> tampered with
    your keystore file, the most likely cause is that Tomcat is using
    a different password than the one you used when you created the
    keystore file.  To fix this, you can either go back and
    <a href="#Prepare the Certificate Keystore">recreate the keystore
    file</a>, or you can add or update the <code>keystorePass</code>
    attribute on the <code>&lt;Factory&gt;</code> element in the
    <a href="#Edit the Tomcat Configuration File">Tomcat configuration
    file</a>.  <strong>REMINDER</strong> - Passwords are case sensitive!</p>
    </blockquote></li>
</primary>
  <li>
    Tomcatの起動時に、"java.io.FileNotFoundException: 
    Keystore was tampered with, or password was incorrect"
    が返される。
    <blockquote>
    <p>
    <em>実際に</em>キーストアファイルが改ざんされていないと仮定した場合に一番考えられる原因は、キーストアファイルを生成したときに使用したのと異なるパスワードをTomcatが使用していることです。これを解決するにはいったん前の方のステップに戻って<a href="#Prepare the Certificate Keystore">キーストアファイルを再生成する</a>か、<a href="#Edit the Tomcat Configuration File">Tomcat設定ファイル</a>の<code>&lt;Factory&gt;</code>要素に<code>keystorePass</code>属性を追加または更新します。
    <strong>注意</strong> - パスワードは大文字小文字を区別します！
    </p>
    </blockquote>
  </li>

</ul>

<primary>
<p>If you are still having problems, a good source of information is the
<strong>TOMCAT-USER</strong> mailing list.  You can find pointers to archives
of previous messages on this list, as well as subscription and unsubscription
information, at
<a href="http://jakarta.apache.org/site/mail.html">http://jakarta.apache.org/site/mail.html"</a>.</p>
</primary>
<p>
それでもまだ問題があれば、<strong>TOMCAT-USER</strong>メーリングリストがよい情報源となります。入会および退会に関する情報や、過去のメッセージのアーカイブの場所については、<a href="http://jakarta.apache.org/site/mail.html">http://jakarta.apache.org/site/mail.html"</a>で見つけることができます。
</p>

</section>

</body>

</document>
