設定路由器和訊息處理器之間的傳輸層安全標準 (TLS)

根據預設,路由器和訊息處理器之間的 TLS 會停用。

如要啟用路由器和訊息處理器之間的 TLS 加密功能:

  1. 確認路由器可存取訊息處理器的通訊埠 8082。
  2. 產生 KeyStore JKS 檔案,其中包含 TLS 憑證和私密金鑰。詳情請參閱「為 Edge On-Premises 設定 TLS/SSL」。
  3. 將金鑰儲存庫 JKS 檔案複製到訊息處理器伺服器上的目錄,例如 /opt/apigee/customer/application。
  4. 變更 JKS 檔案的權限和擁有權:
    chown apigee:apigee /opt/apigee/customer/application/keystore.jks
    chmod 600 /opt/apigee/customer/application/keystore.jks

    其中 keystore.jks 是 KeyStore 檔案的名稱。

  5. 編輯 /opt/apigee/customer/application/message-processor.properties 檔案。 如果檔案不存在,請建立檔案。
  6. 在 message-processor.properties 檔案中設定下列屬性:
    conf_message-processor-communication_local.http.ssl=true
    conf/message-processor-communication.properties+local.http.port=8443
    conf/message-processor-communication.properties+local.http.ssl.keystore.type=jks
    conf/message-processor-communication.properties+local.http.ssl.keystore.path=/opt/apigee/customer/application/keystore.jks
    conf/message-processor-communication.properties+local.http.ssl.keyalias=apigee-devtest
    # Enter the obfuscated keystore password below.
    conf/message-processor-communication.properties+local.http.ssl.keystore.password=OBF:obsPword

    其中 keystore.jks 是 KeyStore 檔案,obsPword 則是經過模糊處理的 KeyStore 和金鑰別名密碼。

    注意:

    conf/message-processor-communication.properties+local.http.ssl.keyalias=apigee-devtest
    必須與 keytool 指令的 -alias 選項提供的值相同,如「建立 JKS 檔案」一節結尾所述。

    如要瞭解如何產生模糊處理的密碼,請參閱「為 Edge On Premises 設定 TLS/SSL」。

  7. 確認 message-processor.properties 檔案的擁有者是「apigee」使用者:
    chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
  8. 停止訊息處理器和路由器:
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor stop
    /opt/apigee/apigee-service/bin/apigee-service edge-router stop
  9. 在路由器上,刪除 /opt/nginx/conf.d 目錄中的所有檔案:
    rm -f /opt/nginx/conf.d/*
  10. 啟動訊息處理器和路由器:
    /opt/apigee/apigee-service/bin/apigee-service edge-message-processor start
    /opt/apigee/apigee-service/bin/apigee-service edge-router start
  11. 針對每個訊息處理器重複執行這個程序。

在路由器和訊息處理器之間啟用 TLS 後,訊息處理器記錄檔會包含以下 INFO 訊息:

MessageProcessorHttpSkeletonFactory.configureSSL() : Instantiating Keystore of type: jks

這項 INFO 陳述式可確認路由器和訊息處理器之間的 TLS 運作正常。

下表列出 message-processor.properties 中所有可用的屬性:

屬性 說明
conf_message-processor-communication_local.
  http.host=localhost_or_IP_address
(選用步驟) 路由器連線要監聽的主機名稱。這會覆寫註冊時設定的主機名稱。
conf/message-processor-communication.
  properties+local.http.port=8998
(選用步驟) 監聽路由器連線的通訊埠。預設值為 8998。
conf_message-processor-communication_local.
  http.ssl=[ false | true ]
如要啟用 TLS/SSL,請將此值設為 true。預設為 false。啟用 TLS/SSL 時,您必須設定 local.http.ssl.keystore.path 和 local.http.ssl.keyalias。
conf/message-processor-communication.
  properties+local.http.ssl.keystore.path=
金鑰儲存庫 (JKS 或 PKCS12) 的本機檔案系統路徑。local.http.ssl=true 時,必須提供這項屬性。
conf/message-processor-communication.
  properties+local.http.ssl.keyalias=
用於 TLS/SSL 連線的金鑰庫金鑰別名。local.http.ssl=true 時,必須提供這項屬性。
conf/message-processor-communication.
  properties+local.http.ssl.keyalias.password=
用於加密 KeyStore 內金鑰的密碼。請使用下列格式的模糊處理密碼:
OBF:obsPword
conf/message-processor-communication.
  properties+local.http.ssl.keystore.type=jks
金鑰儲存庫類型。目前僅支援 JKS 和 PKCS12。預設值為 JKS。
conf/message-processor-communication.
  properties+local.http.ssl.keystore.password=
(選用步驟) KeyStore 的模糊處理密碼。請使用下列格式的模糊處理密碼:
OBF:obsPword
conf_message-processor-communication_local.
  http.ssl.ciphers=cipher1,cipher2
(選用步驟) 設定完成後,系統只會允許使用列出的密碼。如未指定,則會使用 JDK 支援的所有加密。