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

Edge for Private Cloud 4.17.09 版

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

請按照下列程序,在路由器和訊息處理器之間啟用 TLS 加密:

  1. 確認路由器可存取訊息處理器的通訊埠 8082。
  2. 產生 KeyStore JKS 檔案,其中包含 TLS 憑證和私密金鑰。詳情請參閱「為 Edge On-Premises 設定 TLS/SSL」。
  3. 將 KeyStore 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 和 keyalias 密碼。如要瞭解如何產生模糊處理的密碼,請參閱「為 Edge On Premises 設定 TLS/SSL」。
  7. 確認 message-processor.properties 檔案的擁有者是「apigee」使用者:
    > chown apigee:apigee /opt/apigee/customer/application/message-processor.properties
  8. 停止 Message-Processor 和路由器:
    /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. 啟動 Message-Processor 和路由器:
    /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>

將此值設為 true,即可啟用 TLS/SSL。預設值為 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:xxxxxxxxxx

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:xxxxxxxxxx

conf_message-processor-communication_local.http.ssl.ciphers=<cipher1,cipher2>

(選用步驟) 設定後,系統只允許使用列出的加密。如未指定,則會使用 JDK 支援的所有加密。