JIRA を SSL または HTTPS 上で実行する

アトラシアンの製品はSSLに対応しています。しかし、アトラシアンのサポートはその設定に対して支援は行いません。したがって、アトラシアンは、そのためのサポートの提供を保証できません

  • SSL証明書の変更に際してサポートが必要であれば、証明書の提供元のベンダーに相談してください。
  • 設定に関してサポートが必要であれば、Atlassian Answers に質問をあげてください。

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

Why should you enable HTTPS access to JIRA?
HTTPS is a good way to safeguard your JIRA data and user logins from being intercepted and read by outsiders.

はじめる前に

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

  • アトラシアンのサポートは、SSL のサポートについては証明書を発行する認証局 (CA) に委ねます。このページにおける SSL 関連の説明は参考情報としてのみ提供されます。
  • 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.

If hosting JIRA behind a reverse-proxy such as Apache, please follow our Integrating JIRA with Apache using SSL documentation.

Java キーストアの生成

このセクションでは、お客様の SSL 証明書を保存する Java キーストア (JKS) を作成します。SSL 証明書は、JIRA において SSL 通信を行うためには必須のものです。SSL 証明書は一般的に 2 つの種類に区分されます :

証明書説明 使用目的手順
自己署名証明書

ウェブサーバー証明書の正当性を確認する方法のひとつである CA によるデジタル署名がない証明書です。自分自身が自己名で署名します。

テスト用、開発用、その他内部向けサーバーのみです。

1 - 13
CA 署名証明書認証局 (CA) のデジタル署名によって正当性が確認された証明書です。これにより、ブラウザやクライアントは証明書に信用を置くことが可能になります。本番環境用サーバー1 - 21

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.

よく知られた認証局の例を次に示します:

当社としては、CA で署名された証明書の利用を推奨いたします。

お客様のサーバーに Portecle をインストールすることができない場合や、コマンドラインの利用をご希望の場合は、このページ下部にある コマンドラインを使用したインストール セクションをご覧ください。

  1. Download and install the Portecle app onto the server that runs JIRA.
    (warning) This is a third-party application and is not supported by Atlassian.
  2. Run the App as an Administrator, so it will have the appropriate permissions. Also, ensure the <JAVA_HOME> variable is pointing to the same version of Java that JIRA uses. See our Setting JAVA_HOME docs for further information on this.
    (info) If running on a Linux/UNIX server, X11 will need to be forwarded when connecting to the server (so you can use the GUI), as below:

    ssh -X user@server
  3. Select the Create a new Keystore option:
  4. Select the type JKS and OK:
  5. Select the Generate Key Pair button:
  6. Select the RSA algorithm and your preferred Key Size - the standard is currently 2048:
  7. Make sure the Signature Algorithm is "SHA256withRSA" and then edit the certificate details, as per the below example and select OK:

    (warning) The Common Name MUST match the server's URL, otherwise errors will be displayed in the browser.
    (info) If you would like to use SHA256withRSA, please use the appropriate Signature Algorithm, and refer to: Security tools report the default SSL Ciphers are too weak
  8. 証明書のエイリアス名を指定します。ここでは、jira を使用しています。
  9. キーストアのパスワードを入力します (既定のパスワードは通常 changeit です)。
  10. 下の例のように、キーペアの生成が成功した旨のメッセージが表示されます :
  11. パスワードがステップ 11 と同一であることを確認し、キーストアを <JIRA_HOME>/jira.jks に保存します。[ファイル] > [キーストアの保存] を選択して保存できます。

    If using a self-signed certificate certificate, proceed to Configuring your web server using the JIRA configuration tool, otherwise continue on.

  12. We need to generate a Certificate Signing Request for the CA to sign and confirm the identity of the certificate. To do so, right click on the certificate and choose Generate CSR. Save it in <JIRA_HOME>/jira.csr.
  13. 証明書要求 (CSR) を認証局に送信して署名を求めます。認証局からは、署名済み証明書 (CA 応答) および CA のルート証明書/中間証明書のセットが返送されます。
  14. Import the root and/or intermediate CA certificates with Import Trusted Certificate, repeating this step for each certificate.
  15. Import the signed certificate by right clicking on the jira certificate and selecting Import CA Reply:
  16. CA から提供された証明書 (jira.crt) を選択します。これで、CA 応答のインポートが完了しました。
  17. 結果を、Tools > Keystore Report で確認します。証明書はルート証明書の子ノードに表示されます。
  18. キーストアを保存し、次のセクションに進みます :

JIRA 設定ツールを利用した web サーバーの設定

In this section, you will finish setting up SSL encryption for JIRA, by configuring your web server using the JIRA configuration tool. For more information on the JIRA configuration tool, see Using the JIRA Configuration Tool.

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 (HTTP を HTTPS へリダイレクト)
    • HTTPS のみ

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

    HTTP ポートLeave as default (8080). 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 (8443). You can change the port number if you wish. See Changing JIRA's TCP Ports .
    Keystore パス証明書のキーストアの場所を指定します。これは手順 13 でキーストアを保存した際に選択され、<JIRA_HOME>/jira.jks となります。
    Keystore パスワードキーストアのパスワードを指定します。自己署名証明書を生成した場合は、このパスワードは手順 13 で証明書を生成したときにキーおよびキーストアに設定したパスワードです。
    Keystore エイリアスキーストア内のそれぞれの項目はエイリアスで区別されます。手順 10 で説明したように、証明書について jira を使用することを推奨します。
  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 in The HTTP Connector Apache Tomcat 7 docs.

コマンド ラインを使用したインストール

キーストアを作成します

  1. Java キーストア (JKS) の生成 :

    <JAVA_HOME>/keytool -genkeypair -alias jira -keyalg RSA -sigalg SHA256withRSA -keystore <JIRA_HOME>/jira.jks

    (info) Instead of first and last name, enter the server URL, excluding "https://" (e.g.: jira.atlassian.com).

  2. Enter an appropriate password (e.g.: changeit).
  3. 手順 2 のパスワードを使用して、署名のための CSR を生成します :

    <JAVA_HOME>/keytool -certreq -keyalg RSA -alias jira -keystore <JIRA_HOME>/jira.jks -file jira.csr
  4. Submit the CSR to the CA for signing. They will provide a signed certificate and a root and/or intermediate CA.
    (warning) If the certificate will not be signed, skip to step 7.
  5. ルート証明書、または中間証明書をインポートします :

    <JAVA_HOME>/keytool -import -alias rootCA -keystore <JIRA_HOME>/jira.jks -trustcacerts -file root.crt
  6. (CA から返送された) 署名済み証明書をインポートします :

    <JAVA_HOME>/keytool -import -alias jira -keystore <JIRA_HOME>/jira.jks -file jira.crt
  7. Keystore 内に証明書が存在することを検証します。

    <JAVA_HOME>/keytool -list -alias jira -keystore <JIRA_HOME>/jira.jks

    This must be a PrivateKeyEntry, if it is not the certificate setup has not successfully completed. For example:

    jira, Jan 1, 1970, PrivateKeyEntry,
    Certificate fingerprint (MD5): 73:68:CF:90:A8:1D:90:5B:CE:2A:2F:29:21:C6:B8:25

Keystore で Tomcat を更新する

  1. Create a backup of <JIRA_INSTALL>/conf/server.xml before editing it.

  2. HTTPS コネクタを編集し、キーストアを示すパラメーターを含めます。

    <Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
                  maxHttpHeaderSize="8192" SSLEnabled="true"
                  maxThreads="150" minSpareThreads="25"
                  enableLookups="false" disableUploadTimeout="true"
                  acceptCount="100" scheme="https" secure="true"
                  clientAuth="false" sslProtocol="TLS" useBodyEncodingForURI="true"
                  keyAlias="jira" keystoreFile="<JIRA_HOME>/jira.jks" keystorePass="changeit" keystoreType="JKS"/>

    (info) Ensure to put the appropriate path in place of <JIRA_HOME> and change the port as needed.

  3. HTTP コネクタを編集し、HTTPS コネクタへリダイレクトするようにします。

    <Connector acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" enableLookups="false" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" port="8080" protocol="HTTP/1.1" redirectPort="<PORT_FROM_STEP_1>" useBodyEncodingForURI="true"/>

    (info) Ensure the <PORT_FROM_STEP_1> is change to the appropriate value. In this example it would be 8443.

  4. Save the changes to server.xml.

  5. HTTPS へのリダイレクトを使用する場合 (推奨)、JIRA_INSTALL>/atlassian-jira/WEB-INF/web.xml ファイルを編集し、ファイルの末尾に次のセクションを追加してから、</web-app> を閉じます。この例では、添付ファイルを除くすべての URL が HTTP から HTTPS にリダイレクトされます。

    <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>
  6. 変更を保存したら JIRA を再起動します。

(info) You can also 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.

トラブルシューティング

上記にある通り Portecle を用いて生成した自己署名キーを使用する場合の、トラブルシューティングの TIPS をいくつか紹介します。

ブラウザに「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 検索を行うとこれに関する多くの情報が得られます。

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

    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="<location of keystore file>"
    

    これ ("Cannot find /root/.keystore") は、keystoreFile 属性を https コネクタではなく server.xml の http コネクタに誤って追加した場合にも発生します。

  • キーストア内の証明書応答と証明書が同一 :

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

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

  •  不正なパスワード

     

    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: No available certificate corresponds to the SSL cipher suites which are enabled.
    

    キーストア内に複数の証明書がある場合、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"
    	... />

    Connector 要素のパラメーターの詳細については、Tomcat 7 ドキュメントの「SSL Configuration HOW-TO」をご参照ください。

  • Using StartCom Certificate: Unable to get Application Link to work properly with certain features such as Gadgets and Macros not working over SSL. There is a known bug in JRA-33643 with a workaround to manually import root certificates to Java certificates store.
最終更新日: 2018 年 12 月 10 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.