---
schema_version: "1"
id: 6a890968101ce34a163d26609a56ffa07ff5e43852a541743ebf9453ba139da9
title: 設定 Postgres SSL 以允許從用戶端直接連線
collection: tableau
version: current
locale: zh-tw
portal_url: https://docs.salesforce.com/tableau/current/zh-tw/server/ssl_config_direct_cx.md
canonical_url: https://help.tableau.com/current/server/zh-tw/ssl_config_direct_cx.htm
source_site: help.tableau.com
content_type: documentation
content_hash: b04c64d6f6f906a40ce7618e66f0d9e2fbaba4a0d5c545cb72733da2bfb215e0
description: Configure Postgres SSL to allow direct client connections to the repository.
---
[跳至主要內容](#main-content)

# 設定 Postgres SSL 以允許從用戶端直接連線

將 Tableau Server 設定為使用 SSL 與 Postgres 存放庫進行內部通訊後，還可以要求 Tableau 用戶端和直接連線到存放庫的外部 Postgres 用戶端比較內部 Postgres 執行個體提供的 SSL 憑證和分發給 Tableau 或外部 Postgres 用戶端的憑證，以驗證 Tableau Postgres 存放庫的身分識別。

直接連線包括使用 **tableau** 使用者或 **readonly** 使用者的直接連線。Tableau 用戶端的範例包括 Tableau Desktop、Tableau Mobile、REST API、Web 瀏覽器。

1. 透過執行以下命令為存放庫啟用內部 SSL：
    
    `tsm security repository-ssl enable`
    
    `tsm pending-changes apply`
    
    這將啟用內部 SSL 支援，並產生新伺服器憑證和金鑰檔，並要求所有 Tableau 用戶端使用 SSL 連線到存放庫。有關其他 repository-ssl 命令和選項，請參閱[tsm security](https://help.tableau.com/current/server/zh-tw/cli_security_tsm.htm)。
    
    如果擱置組態需要重新啟動伺服器，`pending-changes apply` 命令將顯示提示，讓您知道即將重新啟動。即使伺服器已停止，也會顯示提示，但在這種情況下不會重新啟動。您可以使用 `--ignore-prompt` 選項隱藏提示，但這樣做不會改變重新啟動行為。如果變更不需要重新啟動，則不會出現提示即可套用變更。有關詳情，請參閱 [tsm pending-changes apply](https://help.tableau.com/current/server/zh-tw/cli_pending-changes.htm#pending-changes-apply)。
2. （可選）如果已將用戶端電腦設定為驗證 Postgres SSL 連線，則必須將 Tableau Server 產生的憑證匯入執行 Tableau Desktop 的電腦。對於將直接連線到存放庫的每台用戶端電腦，執行以下操作：
    
    - 將 **server.crt** 檔案複製到用戶端電腦。您可以在以下目錄中找到此檔案：
        
        `C:/ProgramData/Tableau/Tableau Server/data/tabsvc/config/pgsql_0.<version_code>/security`
        
        **附註：**不要將 **server.key** 複製到用戶端電腦。此檔案應位於伺服器上。
    - 將憑證匯入電腦的憑證存放區。
        
        有關資訊，請使用作業系統製造商提供的文件。
3. （可選）設定任何外部（非 Tableau）Postgres 用戶端（例如 PgAdmin 或 Dbeaver），以驗證 Tableau Server Postgres 存放庫的身分識別。在用戶端用於連線的 postgresql JDBC 驅動程式中執行此操作，方法是將「sslmode」指示詞設定為「verify-ca」或「verify-full」。可用的選項可能會有所不同，具體取決於所使用的 postgres 驅動程式的版本。有關詳情，請參閱有關 SSL 支援的磁碟文件。