2.4. Elytron を使用してドメインモードで SSL を設定する

JBoss EAP 7.1 以降のバージョンでは、Elytron を使用してドメインモードで SSL を設定できます。

前提条件

  • JBoss EAP 7.1 以降
  • Elytron

手順

  1. SSL を有効にする自己署名証明書を作成します。

    keytool -genkey -alias jboss -keysize 2048 -validity 365 -keyalg RSA -sigalg SHA256withRSA -keystore jboss.jks -storepass jboss@123 -keypass jboss@123 -dname "CN=example.com, OU=JavaEE, O=Red Hat, C=IN"
  2. 管理 CLI を使用して keystore、key-manager、および ssl-context を作成します。

    #Configure a keystore
    /profile=<profile-name>/subsystem=elytron/key-store=httpsKS:add(path="${jboss.home.dir}/ssl/jboss.jks", credential-reference={clear-text=jboss@123}, type=JKS)
    
    #Create a new key-manager
    /profile=<profile-name>/subsystem=elytron/key-manager=httpsKM:add(key-store=httpsKS,algorithm="SunX509",credential-reference={clear-text=jboss@123})
    
    #Configure new server-ssl-context reference with protocol and ciphers
    /profile=<profile-name>/subsystem=elytron/server-ssl-context=httpsSSC:add(key-manager=httpsKM,protocols=["TLSv1.2"])
  3. Elytron ssl-context をマップするように undertow サブシステムを設定します。

    batch
    /profile=<profile-name>/subsystem=undertow/server=default-server/https-listener=https:undefine-attribute(name=security-realm)
    /profile=<profile-name>/subsystem=undertow/server=default-server/https-listener=https:write-attribute(name=ssl-context,value=httpsSSC)
    run-batch
  4. オプション: management-interface を保護して、同じ ssl-context を使用します。

    host-*.xml ファイルは、管理インターフェイスを保持するドメインコントローラーとホストコントローラーの設定を定義します。SSL が正常に設定されていることを確認するには、ホストで ssl-context を再度定義する必要があります。

    #Configure a keystore on the master DC host
    /host=<host-name>/subsystem=elytron/key-store=httpsKS:add(path="${jboss.home.dir}/ssl/jboss.jks", credential-reference={clear-text=jboss@123}, type=JKS)
    
    #Create a new key-manager on the master DC host
    /host=<host-name>/subsystem=elytron/key-manager=httpsKM:add(key-store=httpsKS,algorithm="SunX509",credential-reference={clear-text=jboss@123})
    
    #Configure new server-ssl-context reference with protocol and ciphers on the master DC host
    /host=<host-name>/subsystem=elytron/server-ssl-context=httpsSSC:add(key-manager=httpsKM,protocols=["TLSv1.2"])
    
    #Configure the secure-port and ssl-context for management-http interface  on the master DC host
    /host=<host-name>/core-service=management/management-interface=http-interface:write-attribute(name=ssl-context,value=httpsSSC)
    
    /host=<host-name>/core-service=management/management-interface=http-interface:write-attribute(name=secure-port,value=9993)
  5. リモートホストコントローラーが SSL 経由でドメインコントローラーに接続できるように、トラストストアが適切に設定されていることを確認します。詳細は、Elytron を使用したドメインコントローラーとホストコントローラー間の SSL/TLS の設定 を参照してください。
  6. サーバーをリロードして、変更が有効であることを確認します。

    reload --host=<host-name>

検証

  • Red Hat Enterprise Linux コマンドラインでブラウザーまたは openSSL を使用して、TLS 接続を確認します。

    openssl s_client -connect host:8443

    出力には、使用されている証明書と TLS バージョンに関する情報が表示されます。

    SSL-Session:
    Protocol: TLSv1.2