Confluence 3.4 のサポートは終了しています。
ドキュメントの最新バージョンを確認してください。
このドキュメントでは、Confluence へ/からの転送中に、Confluence ログインおよびデータが暗号化されるように、Confluence を設定して HTTPS でのアクセスを有効する方法を示します。SSL 暗号化は、Confluence データやユーザーログインが、部外者から傍受されたり読まれたりするのを防ぐ優れた方法です。
ここでは以下のプラットフォームについて説明します。
- Confluence Standalone or Confluence WAR distribution using Tomcat. Apache Tomcat is the application server shipped with Confluence, and is the only supported application server. If you are using a different application server or Apache HTTP Server ("httpd"), see the page on Apache with mod_proxy for instructions on how to terminate an SSL connection at the Apache web server.
- Java 6. Sun JDK 1.6 is the supported Java version for Confluence. Note also that you need the JDK, since it includes the
keytool
utility used in the instructions below. The JRE is not enough. If you are using JDK 1.5, please refer to the Java SE documentation to see the differences in thekeytool
utility from JDK 1.5 to JDK 1.6.
このページの内容
ステップ 1.新しい SSL 証明書を作成または要求する
You will need a valid SSL certificate before you can enable HTTPS. If you already have a certificate prepared, skip to step 2 below.
自己署名証明書を作成するか、認証局(CA、証明機関とも呼ばれます)によって発行された証明証を使用するかを選択することができます。以下で2つのオプションを説明しています。
証明書オプション 1 – 自己署名証明書を作成する
暗号化が必要だが web サイトのリクエストの身元を確認する必要がない場合、自己署名証明書が役立ちます。一般的に、自己署名証明書はテスト環境や社内ネットワーク(イントラネット)で使用します。
証明書が認証局(CA)によって署名されていないため、ユーザーはサイトが信頼されていないというメッセージを受け取り、サイトにアクセスする前に、証明書を承認するいくつかのステップを実行する必要があります。これは通常、サイトに初めてアクセスする際に発生します。
Follow the steps below to generate a certificate using Java's keytool
utility. This tool is included in the JDK.
- Use Java's
keytool
utility to generate the certificate:- Windows の場合、コマンド プロンプトで以下のコマンドを実行します。
"%JAVA_HOME%\bin\keytool" -genkeypair -alias tomcat -keyalg RSA
- OSX または UNIX ベースのシステムの場合、コマンド プロンプトで以下のコマンドを実行します。
$JAVA_HOME/bin/keytool -genkeypair -alias tomcat -keyalg RSA
- Windows の場合、コマンド プロンプトで以下のコマンドを実行します。
- When asked for a password:
- 証明書に使用するパスワード(秘密鍵)を指定します。パスワード文字列は入力したとおりに表示されないことに注意してください。
- 設定ファイルを編集する場合、次のステップでこれが必要になるため、選択したパスワードをメモします。
- 既定のパスワードは "
changeit
" です。
- Follow the prompts to specify your name, organisation and location. This information is used to construct the X.500 Distinguished Name (DN) of the entity, such as:
CN=Java Duke, OU=Java Software Division, O=Sun Microsystems Inc, C=US
- Enter '
y
' to confirm the details. - When asked for the password for '
tomcat
' (the alias you entered in the keytool command above), press the 'Enter' key. This specifies that your keystore entry will have the same password as your private key. You MUST use the same password here as was used for the keystore password itself. This is a restriction of the Tomcat implementation. - You certificate is now ready. Go to step 2 below.
証明書オプション 2 – 認証局が発行した証明書を使用する
When running Confluence in a production environment, you will need a certificate issued by a certificate authority (CA, sometimes also called a 'certification authority') such as VeriSign, Thawte or TrustCenter. The instructions below are adapted from the Tomcat documentation.
まず、ローカル証明書を作成し、その証明書に基づいて「証明書署名要求」(CSR)を作成します。CSR を選択した認証局に提出します。CA は証明書を生成するために、その CSR を使用します。
- Use Java's
keytool
utility to generate a local certificate, as described in the previous section. - Use the
keytool
utility to generate a CSR, replacing the text<MY_KEYSTORE_FILENAME>
with the path to and file name of the.keystore
file generated for your local certificate:keytool -certreq -keyalg RSA -alias tomcat -file certreq.csr -keystore <MY_KEYSTORE_FILENAME>
- Submit the generated file called
certreq.csr
to your chosen certificate authority. Refer to the documentation on the CA's website to find out how to do this. - CA が証明書を送信します。
- 新しい証明書をローカルのキーストアにインポートします。
keytool -importcert -alias tomcat -keystore <MY_KEYSTORE_FILENAME> -file <MY_CERTIFICATE_FILENAME>
ステップ 2.Confluence インストールのサーバー設定ファイルを編集する
- Edit the server configuration file at this location: {
CONFLUENCE-INSTALLATION}>/conf/server.xml
. - 以下の行をコメント アウトします。
<Connector port="8443" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" SSLEnabled="true" URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>"/>
- Replace the text <
MY_CERTIFICATE_PASSWORD>
with the password you specified for your certificate. - 上記のように、属性 - 値ペア
SSLEnabled="true"
がConnector
要素の一部であることを確認します。この属性が存在しない場合、Confluence へのアクセス試行がタイム アウトします。 - サーバー設定ファイルを保存します。
ステップ 3.証明書の場所を指定する
Tomcat はデフォルトで、キーストア ファイルの名前が .keystore
であることと、およびそのファイルが Tomcat を実行されているユーザーのホーム ディレクトリ (自身のホーム ディレクトリとは異なる可能性があります) にあることを想定しています。つまり、Tomcat はデフォルトでは以下の場所で SSL 証明書を探します。
- Windows:
C:\Documents and Settings\\#CURRENT_USER#\.keystore
- OS X および UNIX ベースのシステムの場合:
~/.keystore
証明書をユーザー定義の場所に移動することができます。以下で説明するように、証明書をデフォルトの場所から移動させる場合、Tomcat が証明書を見つけることができるように、サーバー設定ファイルを更新する必要があります。
- Edit the server configuration file at this location: {
CONFLUENCE-INSTALLATION}>/conf/server.xml
- Add the attribute
keystoreFile="<MY_CERTIFICATE_LOCATION>"
to theConnector
element, so that the element looks like this:<Connector port="8443" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" disableUploadTimeout="true" acceptCount="100" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" SSLEnabled="true" URIEncoding="UTF-8" keystorePass="<MY_CERTIFICATE_PASSWORD>" keystoreFile="<MY_CERTIFICATE_LOCATION>"/>
- テキスト
<MY_CERTIFICATE_LOCATION>
を、.keystore
ファイルの名前とパスを含む、証明書へのパスで置き換えます。 - サーバー設定ファイルを保存します。
ステップ 4.Confluence のベース URL を HTTPS に変更する
- ブラウザで、Confluence 管理コンソールに移動します。
- Change the Server Base URL to HTTPS. See the documentation on configuring the server base URL.
- Restart Tomcat and access Confluence on
https://<MY_BASE_URL>:8443/
.
Step 5. Add a Security Constraint to Cause Redirect of All URLs to HTTPS
Although HTTPS is now activated and available, the old HTTP URLs (http://localhost:8080) are still available. Now you need to redirect the URLs to their HTTPS equivalent. You will do this by adding a security constraint in web.xml
. This will cause Tomcat to redirect requests that come in on a non-SSL port.
- Check whether your Confluence site uses the RSS macro. If your site has the RSS macro enabled, you may need to configure the URL redirection with a firewall rule, rather than by editing the
web.xml
file. Skip the steps below and follow the steps on the RSS Feed Macro page instead. - または、
<CONFLUENCE_INSTALLATION>/confluence/WEB-INF/web.xml
でファイルを編集します。 - Add the following declaration to the end of the file, before the
</web-app>
tag:<security-constraint> <web-resource-collection> <web-resource-name>Restricted URLs</web-resource-name> <url-pattern>/</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
- Restart Confluence and access http://localhost:8080. You should be redirected to https://localhost:8443/login.action.
Confluence Standalone has two web.xml files. The other one is at
<CONFLUENCE_INSTALLATION>/conf/web.xml
. Please only add the security constraints to <CONFLUENCE_INSTALLATION>/confluence/WEB-INF/web.xml
, as described above.
注意
- Background information on generating a certificate: The '
keytool -genkeypair
' command generates a key pair consisting of a public key and the associated private key, and stores them in a keystore. The command packages the public key into an X.509 v3 self-signed certificate, which is stored as a single-element certificate chain. This certificate chain and the private key are stored in a new keystore entry, identified by thealias
that you specify in the command. The Java SE documentation has a good overview of the utility.
- カスタム SSL ポート: SSL コネクタが実行されているポートを既定値の 8443 から変更した場合、新しい SSL ポートを反映するには、標準 HTTP コネクタの
redirectPort
属性を更新する必要があります。Tomcat は、受信リクエストの安全性を確保する必要がある場合のリダイレクト先のポートを確認するために、この情報を必要とします。
- Protection for logins only or for individual spaces: As of Confluence 3.0, Atlassian does not support HTTPS for logins only or for specific pages. We support only site-wide HTTPS. To see the reasoning behind this decision, please see CONF-18120 and CONF-4116.
トラブルシューティング
- Check the Confluence knowledge base articles on troubleshooting SSL.
- If any of your users will access Confluence from Internet Explorer 7 on Vista, please note the following additional points when using Java's
keytool
utility:- Make sure that you specify the
-keyalg RSA
option, as shown in the example of thekeytool
command above. The default is the SHA1 algorithm, which results in an error 'Internet Explorer cannot display the webpage' on IE7 on Vista. - You may also need to specify the
-sigalg MD5withRSA
option. Otherwise, SHA1 will be used even if you specify the-keyalg RSA
option. See this Atlassian blogpost for more information.
- Make sure that you specify the
- Problems with Internet Explorer being unable to download attachments: Applying SSL site wide can prevent IE from downloading attachments correctly. To fix this problem, edit
<CONFLUENCE_INSTALLATION>/conf/server.xml
and add the following line within the<Context ... />
element:<Valve className="org.apache.catalina.authenticator.NonLoginAuthenticator" disableProxyCaching="true" securePagesWithPragma="false" />
関連トピック
- SSL Configuration HOW-TO in the Apache Tomcat 6.0 documentation
- SSL Configuration HOW-TO in the Apache Tomcat 5.5 documentation
- keytool - Key and Certificate Management Tool in the Java SE documentation
- Connecting to LDAP or JIRA or Other Services via SSL
- サポート対象プラットフォーム