自己署名証明書を使用する場合
アトラシアンの製品はSSLに対応しています。しかし、アトラシアンのサポートはその設定に対して支援は行いません。したがって、アトラシアンは、そのためのサポートの提供を保証できません 。
- SSL証明書の変更に際してサポートが必要であれば、証明書の提供元のベンダーに相談してください。
- If assistance with configuration is required, please raise a question on Atlassian Answers.
In order to trust a self-signed certificate, the public certificate need to be imported in the Java keystore that Bitbucket Data Center and Server uses. In this example, it is *.atlassian.com, and we cover how to install it below.
サーバーに Portecle をインストールすることができない場合や、コマンド ラインの利用をご希望の場合は、このページ下部にある コマンド ラインを使用したインストール セクションをご覧ください。
エンドポイントの公開証明書の取得とインポート
- Portecle アプリをダウンロードし、Bitbucket を実行するサーバーにインストールします。
これはサードパーティ製のアプリケーションであり、アトラシアンのサポート対象外です。
Ensure the <JAVA_HOME> variable is pointing to the same version of Java that Bitbucket uses.
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
- [Examine] メニューを選択し、[Examine SSL/TLS Connetcion] をクリックします。
- ターゲットとなるシステムの SSL ホストとポートを入力します。
- 読み込みが完了されるまで待ちます。完了したら、パブリック証明書を選択し、PEM をクリックします。
- 証明書をエクスポートし、保存します。
- Go back to the main screen and select the Open an existing keystore from disk option, select
cacerts
(for example$JAVA_HOME/lib/security/cacerts
) then enter the password (the default ischangeit
). - [信頼済みの証明書をロードされたキーストアにインポートする] ボタンを選択します。
- ステップ 6 で保存した証明書を選択し、適切なエイリアス (例: confluence) を付与して、信頼済みであることを確認します。
- 次のようなエラーが表示される可能性があります。
- これが発生した場合、[OK] をクリックして証明書を信頼済みとして許可します。
- 次のようなエラーが表示される可能性があります。
- キーストアをディスクに保存します。
- Bitbucket を再起動します。
- ホストに接続できることをテストします。
コマンド ラインを使用したインストール
証明書を取得します (google.comを、Bitbucket が接続しようとしているサーバーの FQDN に置き換えます)。
Unix の場合:openssl s_client -connect google.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt
Windows の場合:
openssl s_client -connect google.com:443 < NUL | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > public.crt
上記のコマンドは、環境に Sed for Windows と OpenSSL がインストールされている場合にのみ実行されます。Sed または OpenSSL をインストールしていないか、インストールする予定がない場合、代替手段として以下の手順を利用できます。次のコマンドを発行します。
openssl s_client -connect google.com:443
Save the output to a file called
public.cert.
Edit the thepublic.cert
file so it contains only what is between theBEGIN CERTIFCATE
andEND CERTIFICATE
lines. This is how your file should look like after you edited it:-----BEGIN CERTIFICATE----- < Certificate content as fetched by the command line. Don't change this content, only remove what is before and after the BEGIN CERTIFICATE and END CERTIFICATE. That's what your Sed command is doing for you :-) > -----END CERTIFICATE-----
証明書をインポートします。
<JAVA_HOME>/bin/keytool -import -alias <server_name> -keystore <JAVA_HOME>/jre/lib/security/cacerts -file public.crt
他のキーストアの場所
Java will normally use a system-wide keystore in $JAVA_HOME/jre/lib/security/cacerts
, but it is possible to use a different keystore by specifying a parameter, -Djavax.net.ssl.trustStore=/path/to/keystore, where '/path/to/keystore' is the absolute file path of the alternative keystore.
ただし、この設定は推奨されません。これは、Java にカスタム キーストア (例: 自己署名証明書を含むもの) を使うように指定すると、 Java は $JAVA_HOME/jre/lib/security/cacerts
に含まれる署名認証局のルート証明書へのアクセスや、認証局が署名したほとんどの SSL サイトへのアクセスを行えなくなるためです。代わりに、新しい証明書 (自己署名証明書など) をシステムレベルのキーストア (上記) に追加することをおすすめします。
デバッグ
次のような問題が発生する場合があります。
- 証明書が正しくないキーストアにインストールされている。
- 接続しようとしている SSL サービスの証明書がキーストアに含まれていない。