手順
-
コマンドを使って、自己署名証明書が含まれているキーストアを作成します。
keytool -genkey -keyalg RSA -alias tac-tomcat -keystore tac-tomcat-keystore.jks -storepass tacadmin -validity 3600 -keysize 2048
-
キーストアのパスワードを2回入力し、必要であればその他のオプション情報(名前、組織名、状態など)も入力します。例:
Enter keystore password: Re-enter new password: What is your first and last name? [Unknown]: localhost What is the name of your organizational unit? [Unknown]: Development What is the name of your organization? [Unknown]: Talend What is the name of your City or Locality? [Unknown]: Suresnes What is the name of your State or Province? [Unknown]: FR What is the two-letter country code for this unit? [Unknown]: FR Is CN=localhost, OU=TAC, O=Talend SA, L=Suresnes, ST=FR, C=FR correct? [no]: Y Enter key password for (RETURN if same as keystore password):
キーとファイルで同じパスワードを使用してください。
-
次のファイルを開きます。
<TAC_HOME>/apache-tomcat/conf/server.xml
-
非SSL部分をコメントします。
<Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" throwOnFailure="true" redirectPort="8443" />
-
キーストア証明書をApache Tomcatのトラストストアに追加します。
#export certificate into .cert file keytool -keystore tac-tomcat-keystore.jks -alias tac-tomcat -export -file tac-tomcat.cert #import certificate into jks keytool -keystore tac-tomcat-truststore.jks -alias tac-tomcat -import -file tac-tomcat.cert
この操作は次の例外を避けるために必要です。Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target during user authentication.
-
keystoreFile
パラメーターとkeystorePass
パラメーター、および値を追加します。 -
次のファイルを開きます。
<TAC_HOME>/apache-tomcat/setenv.sh
-
次の行:
set "JAVA_OPTS=$JAVA_OPTS -Xmx4096m -Dfile.encoding=UTF-8"
を以下に変更します。set "JAVA_OPTS=$JAVA_OPTS -Xmx4096m -Dfile.encoding=UTF-8 -Djavax.net.ssl.trustStore=$CATALINA_HOME/conf/tac-tomcat-truststore.jks -Djavax.net.ssl.trustStorePassword=tacadmin"
-
Talend Administration Centerを再起動します。
https://localhost:8443/org.talend.administrator
というアドレスでTalend Administration CenterのURLをチェックします。詳細は、https://tomcat.apache.org/tomcat-9.0-doc/ssl-howto.htmlをご覧ください。