Documentation for JIRA 5.2. Documentation for other versions of JIRA is available too.

このページでは、Apache Tomcat で HTTPS に関する設定を行うことによって JIRA を SSL、または HTTPS 上で実行する手順を説明します。この手順は JIRA が通常の方法でインストールされている場合を前提としており、HTTPS 設定の完全なガイドでも包括的なガイドでもなく、またお客様が個別の設定を行っている場合は適用できないことがあります。

Why should you run JIRA over SSL or HTTPS?
When web applications are being accessed across the internet, there is always the possibility of usernames and passwords being intercepted by intermediaries between your computer and the ISP/company. It is often a good idea to enable access via HTTPS (HTTP over SSL) and make this a requirement for pages where passwords are sent. Note, however, that using HTTPS may result in slower performance.

はじめる前に

作業を始める前に、以下の点を確認してください :

  • Atlassian Support will refer SSL support to the institution that issues the Certificate. The SSL-related instructions on this page are provided as a reference only.
  • Windows インストーラーを使用して JIRA をインストールした場合 :
    • Windows インストーラー は、Tomcat を実行するために独自の Java Runtime Environment (JRE) Java プラットフォームをインストールします。SSL 証明書をアップデートする場合は、JRE のインストレーション中に行う必要があります。
    • In this document, the term <jira-install-dir> refers to the JIRA Installation Directory itself.

 

1. Obtain an SSL certificate

In this section, you will obtain an SSL certificate. An SSL certificate is required in order for SSL to work in JIRA. There are two ways to obtain one:

If you already have a certificate, you can skip to the Import certificate into the trust store section below.

Generate a self-signed certificate

Self-signed certificates are useful in cases where you require encryption but do not need to verify the website identity. They are commonly used for testing and on internal corporate networks (intranets). Due to the certificate not being signed by a Certification Authority (CA), users may get prompted that the site is untrusted and may have to perform several steps to "accept" the certificate before they can access the site. This usually will only occur the first time they access the site.

Please note, the following approach to create the certificate uses Java's keytool, and has been formatted for use with Java 1.6. There are other tools for generating certificates such as openSSL, but the examples will be for keytools.

To generate a self-signed certificate:

  1. Create a new keystore file by running one of the following commands. The keystore file will be created in the home directory of the user you used to run the keytool command.

    オペレーティング システムJIRA Distributionコマンド
    WindowsWindows Installer
    "<jira-install-dir>\jre\bin\keytool" -genkey -alias tomcat -keyalg RSA
    Windows'archive' or 'WAR distribution'
    "%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
    Linuxすべて
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
    Solarisすべて
    $JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA
  2. When the keytool utility prompts you with 'What is your first and last name?', enter the fully qualified hostname of the server running JIRA. Do not enter your first name and last name.

    What is the fully qualified hostname of my server?

    The fully qualified hostname of your server is the name you would type in your web browser after the http:// (no port number) section to access your JIRA installation. When the client web browser examines the certificate, it checks this field, and makes sure that it matches the hostname. If it doesn't, it may prevent access to the site, and at the very least will generate pop-up messages saying that there is a mismatch. An example of a qualified hostname is: support.atlassian.com. Also, make sure the qualified host name matches the base URL you have set in JIRA (without the port).

  3. When the keytool utility prompts you to enter the keystore password and key password for Tomcat, enter your desired passwords. You must use the same value for both passwords. Keep note of this password, as you will need it in the Configuring your web server using the JIRA configuration tool section below.

  4. Export the certificate by running one of the following commands. The certificate has to be exported so that it can be imported into the trust store.

    オペレーティング システムJIRA Distributionコマンド
    WindowsWindows Installer
    "<jira-install-dir>\jre\bin\keytool" -export -alias tomcat -file file.cer
    Windows'archive' or 'WAR distribution'
    "%JAVA_HOME%\bin\keytool" -export -alias tomcat -file file.cer
    Linuxすべて
    $JAVA_HOME/bin/keytool -export -alias tomcat -file file.cer
    Solarisすべて
    $JAVA_HOME/bin/keytool -export -alias tomcat -file file.cer
  5. Next, follow the instructions in the Import certificate into the trust store section below.

Obtain a certificate authority certificate

Digital Certificate that are issued by trusted 3rd party CAs (Certification Authority) provide verification that your Website does indeed represent your company, thereby verifying your company's identity. Many CAs simply verify the domain name and issue the certificate, whereas other such as VeriSign verifies the existence of your business, the ownership of your domain name, and your authority to apply for the certificate, providing a higher standard of authentication.

A list of CA's can be found here. Some of the most well known CAs are:

Next, follow the instructions in the Import certificate into the trust store section below.

2. Import certificate into the trust store

The instructions in this section are a general guide for importing a certificate into the trust store, assuming your certificate is called "file.cer" (whether obtained by a CA or self-generated). Note, your SSL Vendor may have different instructions, please refer to them for proper certificate installation, e.g. GoDaddy, VeriSign, etc.

To import your certificate into the trust store:

Run one of the following commands. Note, the Linux/Solaris commands must be run as the root user, or with the use of sudo.

オペレーティング システムJIRA Distributionコマンド
WindowsWindows Installer
"<jira-install-dir>\jre\bin\keytool" -import -alias tomcat -file file.cer
Windows'archive' or 'WAR distribution'
"%JAVA_HOME%\bin\keytool" -import -alias tomcat -file file.cer
Linuxすべて
$JAVA_HOME/bin/keytool -import -alias tomcat -file file.cer 
Solarisすべて
$JAVA_HOME/bin/keytool -import -alias tomcat -file file.cer 

Next, configure your web server as described in the Configuring your web server using the JIRA configuration tool section below.

3. Configuring your web server using the JIRA configuration tool

このセクションでは、JIRA での SSL 暗号化設定の最後の手順として、JIRA 設定ツールを利用した web サーバーの設定を行います。JIRA 設定ツールの詳細は、JIRA 構成ツールの利用 をご覧ください。

JIRA 設定ツールを利用してウェブサーバーの設定を行う手順 :

  1. 次のように JIRA 設定ツールを起動します :
  2. Click the Web Server tab.
    Screenshot: JIRA configuration tool — 'Web Server' tab
  3. 各フィールドに次のように入力します :

    フィールド
    ポートの制御Leave as default. You can change the port number if you wish. See Changing JIRA's TCP Ports.
    プロフィールProfile とはプリセットされたウェブサーバー動作設定です。次の 4 つの値から選択します :
    • 無効
    • HTTP のみ 
    • HTTP & HTTPS
    • HTTPS のみ

    JIRA を HTTPS 上で実行する場合は、'HTTP & HTTPS' または 'HTTPS' を選択する必要があります。
    JIRA を HTTPS 上で実行するが、ユーザーに HTTP 経由でも JIRA にアクセスさせる場合は、'HTTP & HTTPS' を選択する必要があります。'HTTP & HTTPS' を選択すると、HTTP 経由で JIRA にアクセスするユーザーは HTTPS のアドレスにリダイレクトされます。

    HTTP ポートLeave as default. You can change the port number if you wish. See Changing JIRA's TCP Ports.
    This will be disabled if you set the Profile to 'HTTPS only'.
    HTTPS ポートLeave as default. You can change the port number if you wish. See Changing JIRA's TCP Ports.
    Keystore パスSpecify the location of the keystore of your certificate.
    Keystore パスワードSpecify the password for your keystore. If you generated a self-signed certificate, this is the password you specified for the key and keystore when generating the certificate (see above).
    Keystore エイリアスEach entry in the keystore is identified by an alias. Specify the alias of your certificate.
  4. Check Certificate in Key Store ボタンをクリックして、以下の項目を確認します :
    • キーストア内に証明書が存在すること。
    • キーストアのパスワードが有効であること。
    • キーエイリアスを使用してキーを見つけられること。
  5. Save ボタンをクリックして設定を保存します。

高度な設定

同一ホストにおける複数のインスタンスの実行

When running more than one instance on the same host, it is important to specify the address attribute in the <JIRA_INSTALLATION>/conf/server.xml file because by default the connector will listen on all available network interfaces, so specifying the address will prevent conflicts with connectors running on the same default port. See the Tomcat Connector documentation for more about setting the address attribute: http://tomcat.apache.org/tomcat-5.5-doc/config/http.html

Redirecting certain pages to HTTPS

You can redirect users from HTTP URLs to HTTPS URLs by choosing the 'HTTP & HTTPS' profile in the JIRA configuration tool. However, if you want to only redirect certain pages to HTTPS, you can do this manually. To do this, select the 'HTTPS only' profile in the JIRA configuration tool and save the configuration. Then edit the WEB-INF/web.xml file and add the following section at the end of the file, before the closing </web-app>:

<security-constraint>
<web-resource-collection>
<web-resource-name>all-except-attachments</web-resource-name>
<url-pattern>*.jsp</url-pattern>
<url-pattern>*.jspa</url-pattern>
<url-pattern>/browse/*</url-pattern>
</web-resource-collection>
<user-data-constraint>
<transport-guarantee>CONFIDENTIAL</transport-guarantee>
</user-data-constraint>
</security-constraint>

In the example above, all URLs except attachments are redirected from HTTP to HTTPS.

変更を保存したら JIRA を再起動します。

 

トラブルシューティング

Here are some troubleshooting tips if you are using a self-signed key created by keytool, as described above.

ブラウザに「https://localhost:<port number>」と入力したときに "Cannot establish a connection to the server at localhost:8443" のようなメッセージが表示される場合は、ログ ファイル logs/catalina.out でエラー メッセージを探します。ここには発生する可能性があるいくつかのエラーとそれぞれの説明を紹介します。

  • SSL + Apache + IE の問題 : IEを使用して SSL 経由で添付書類をアップロードした場合にエラーとなることが報告されています。これは IE のバグが原因で、Apache において次の設定を行うことで解決できます :

    BrowserMatch ".MSIE." \
    nokeepalive ssl-unclean-shutdown \
    downgrade-1.0 force-response-1.0
    

    Google has plenty more on this.

  • キーストアが見つからない :

    java.io.FileNotFoundException: /home/user/.keystore (No such file or directory)
    

    これは、Tomcat がキーストアを見つけられなかったことを意味します。キーツール ユーティリティは、現在のユーザーのホーム ディレクトリに .keystore という名称のキーストアをファイルとして作成します。Unix / Linux ではホーム ディレクトリは多くの場合 /home/<username> です。Windows では多くの場合 C:\Documents And Settings\<UserName> です。

    Make sure you are running JIRA as the same user who created the keystore. If this is not the case, or if you are running JIRA on Windows as a service, you will need to specify where the keystore file is in conf/server.xml. Add the following attribute to the connector tag you uncommented:

    keystoreFile="<Keystore ファイルの場所>"
    
  • キーストア内の証明書応答と証明書が同一 :

    keytool error: java.lang.Exception: Certificate reply and certificate in keystore are identical
    
    

    このエラーは、既存のキーストアで cert が再作成されたことによって、同一の名前またはフィンガープリントが存在する場合に発生します。Cert の再作成や更新を行う必要が生じた場合、既存のキーストアを削除して新しいキーストアを作成できます。この場合、新しいキーストアを作成して関連する cert を追加することで問題が解消されます。このドキュメントでは、既定のパスは $JAVA_HOME/jre/lib/security/cacerts です。

  •  Incorrect password:

     

    java.io.IOException: Keystore was tampered with, or password was incorrect
    

     

    "changeit" 以外のパスワードが使われています。Tomcat のキー パスワードとキーストア パスワードの両方で "changeit" を使用するか、異なるパスワードを使用する場合は、前述のように Connector タグの keystorePass 属性にそれを指定する必要があります。

  • パスワードの不一致 :

    java.io.IOException: Cannot recover key
    

    Tomcat のキーストアパスワードとキーパスワードに異なるパスワードが使われていることを意味します。この二つのパスワードは同一でなければなりません。

  • 不正な証明書 :

    javax.net.ssl.SSLException:有効化されている SSL 暗号化スイートと一致する、利用可能な証明書がありません。
    

    キーストア内に複数の証明書がある場合、conf/server.xml 内の SSL Connector タグで指定がある場合を除き、Tomcat は最初に返された証明書を使用します。

    次の例に示すように、コメントを解除した Connector タグに keyAlias 属性を追加し、関連するエイリアスを設定します。

     <Connector port="8443" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" disableUploadTimeout="true" useBodyEncodingForURI="true"
    acceptCount="100" scheme="https" secure="true"
    clientAuth="false" sslProtocol="TLS"
    keystoreFile="/opt/local/.keystore"
    keystorePass="removed"
    keyAlias="tomcat"/>
    
  • Apache Portable Runtime (APR) の使用 :

    APR では異なる SSL エンジンが使用されており、次のような例外処理情報がログに記録されることがあります。

     SEVERE: Failed to initialize connector [Connector[HTTP/1.1-8443]]
    LifecycleException:  Protocol handler initialization failed: java.lang.Exception: No Certificate file specified or invalid file format

    これは APR コネクターが OpenSSL を使用しており、キーストアの使用方法が異なることが原因です。この問題の解決策は 2 通りあります :


    • server.xml ファイルを編集して、アンコメントしたコネクタータグが APR プロトコルの代わりに Http11Protocol を指定することによって、Http11Protocol を使用して SSL コネクションを処理することができます。

      <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
        maxHttpHeaderSize="8192" SSLEnabled="true" keystoreFile="${user.home}/.keystore"
        maxThreads="150" enableLookups="false" disableUploadTimeout="true"
        acceptCount="100" scheme="https" secure="true"
        clientAuth="false" sslProtocol="TLS" useBodyEncodingForURI="true"/>
      
    • コネクターが APR プロトコルを使用するように設定変更してください。この方法は証明書および秘密鍵に PEM エンコーディングを使用している場合にのみ有効です。キー生成の際に OpenSSL を使用している場合は、これらのファイルは PEM エンコーディングされています ‐ それ以外の場合はご利用の認証局にお問い合わせください。

      <Connector
        port="8443" maxThreads="200"
        scheme="https" secure="true" SSLEnabled="true"
        SSLCertificateFile="${user.home}/certificate.pem"
        SSLCertificateKeyFile="${user.home}/key.pem"
        clientAuth="optional" SSLProtocol="TLSv1"/>
      
  • クライアント認証の有効化 : Tomcat でクライアント認証を有効にするには、Tomcat の server.xml ファイルにある Connector 要素の clientAuth 属性の値が true である必要があります。

    <Connector
    	...
    	clientAuth="true"
    	... />

    For more information about Connector element parameters, please refer to the 'SSL Support' section of the Tomcat 6.0 or Tomcat 5.5 documentation.

 

 

 

 

 

  • ラベルなし