How to import a public SSL certificate into a JVM



When connecting two servers via HTTPS, the public SSL certificate from each server must be added to the other server's JVM truststore.


There are 2 ways to import a public SSL certificate into a JVM:

Using Portecle

  1. Download and install the Portecle app onto the server that runs your application.

    This is a third-party application and not supported by Atlassian.

  2. Ensure the <JAVA_HOME> variable is pointing to the same version of Java that your application uses. See our Setting JAVA_HOME docs for further information on this.

     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 Examine menu and then click Examine SSL/TLS Connection:
  4. ターゲットとなるシステムの SSL ホスト、ポートを入力します。
  5. ローディングが実行されるまでしばらく待ちます。ローディング後に公開証明書を選択し、PEM をクリックします。
  6. 証明書をエクスポートし、保存します。
  7. Go back to the main screen and select the Open an existing keystore from disk option, select the truststore file (for example $JAVA_HOME/lib/security/cacerts) then enter the password (the default is changeit).
  8. Select the Import a trusted certificate into the loaded keystore button:
  9. 手順 6 で保存した証明書を選択し、信頼できるかどうか、適切なエイリアス (例:confluence) が与えられているかどうかを確認します。
    1. 以下の様なエラーが表示された場合: 
    2. 該当する場合は 、OK をクリックして信用された証明書を受諾します。
  10. Save the keystore to disk:
  11. Restart your application.
  12. ホストに接続できるかテストします。


  1. Fetch the certificate, replacing with the FQDN of the server JIRA is attempting to connect to:

    openssl s_client -connect -servername < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt


    openssl s_client -connect -servername < NUL | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt

    If you are under a redirection domain page, you must specify always -servername <your_domain_name> in order to ensure we are loading the correct domain, otherwise, openssl takes the first SSL cert he receives, when it should be the second cert that belongs to your domain.

    The command above will only be executed if you have Sed for Windows as well as OpenSSL installed on your environment. If you don't have Sed or OpenSSL or you don't want to install it, use the instructions below as an alternative. Issue the following command:

    openssl s_client -connect -servername

    出力を public.crt. というファイルに保存します。public.crt ファイルを編集し、BEGIN CERTIFCATEEND CERTIFICATE の間の内容だけを含むようにします。編集後は次のようになります。

    < Certificate content as fetched by the command line. 
    Don't change this content, only remove what is before 
    That's what your Sed command is doing for you :-) >
    -----END CERTIFICATE-----
  2. 証明書をインポートする。

    <JAVA_HOME>/bin/keytool -import -alias <server_name> -keystore <JAVA_HOME>/jre/lib/security/cacerts -file public.crt

    Then enter the password if prompted (the default is changeit).

Alternative TrustStore Locations

Java will normally use a system-wide truststore $JAVA_HOME/jre/lib/security/cacerts, but it is possible to use a different truststore by specifying a parameter,, where '/path/to/truststore' is the absolute file path of the alternative truststore. Information on how to configure JIRA startup variables can be found here.

However, setting this is not recommended because if Java is told to use a custom truststore (eg. containing a self-signed certificate), then Java will not have access to the root certificates of signing authorities found in $JAVA_HOME/jre/lib/security/cacerts, and accessing most CA-signed SSL sites will fail. It is better to add new certificates (eg. self-signed) to the system-wide truststore (as above).



  • The certificate was installed into the incorrect truststore.
  • The truststore does not contain the certificate of the SSL service you're connecting to.
説明 When connecting two servers via HTTPS, the public SSL certificate from each server must be loaded on to the other server.
製品 Jira, Confluence, Bamboo, Bitbucket
最終更新日 2019 年 5 月 29 日


Powered by Confluence and Scroll Viewport.