> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/server-administration/runtime/ssl-tcp/ssl-server-files.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 18.9.4. SSL 伺服器檔案的使用

## 18.9.4. SSL 伺服器檔案的使用 [#](#ssl-server-files) <a href="#ssl-server-files" id="ssl-server-files"></a>

[表 18.2](#ssl-file-usage) 彙整了與伺服器上 SSL 設定相關的檔案。（所示的檔案名稱為預設名稱， 本機設定的名稱可能有所不同。）

### 表 18.2. SSL 伺服器檔案的使用 [#](#ssl-file-usage) <a href="#ssl-file-usage" id="ssl-file-usage"></a>

| 檔案                                                                                                                                                          | 內容            | 作用                                |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------- |
| [ssl\_cert\_file](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-connection.md#GUC-SSL-CERT-FILE) (`$PGDATA/server.crt`) | 伺服器憑證         | 傳送給用戶端，用以表明伺服器的身分                 |
| [ssl\_key\_file](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-connection.md#GUC-SSL-KEY-FILE) (`$PGDATA/server.key`)   | 伺服器私密金鑰       | 證明伺服器憑證確實是由擁有者傳送的；但不代表 該憑證擁有者值得信任 |
| [ssl\_ca\_file](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-connection.md#GUC-SSL-CA-FILE)                            | 受信任的憑證授權單位    | 檢查用戶端憑證 是否由受信任的憑證授權單位所簽署          |
| [ssl\_crl\_file](https://docs.postgresql.tw/19/server-administration/runtime-config/runtime-config-connection.md#GUC-SSL-CRL-FILE)                          | 已由憑證授權單位撤銷的憑證 | 用戶端憑證不得出現在此清單中                    |

<br>

伺服器會在啟動時，以及每次重新載入伺服器組態時， 讀取這些檔案。在 Windows 系統上， 每當為新的用戶端連線衍生出新的後端程序時， 這些檔案也會被重新讀取。

若在伺服器啟動時，偵測到這些檔案中有錯誤， 伺服器將拒絕啟動。但若是在組態重新載入期間， 偵測到錯誤，則會忽略這些檔案，繼續使用舊有的 SSL 組態。在 Windows 系統上，若在後端啟動時， 偵測到這些檔案中有錯誤，該後端將無法 建立 SSL 連線。在所有這些情況下， 錯誤狀況都會記錄於伺服器日誌中。

[返回 18.9. 使用 SSL 的安全 TCP/IP 連線](https://docs.postgresql.tw/19/server-administration/runtime/ssl-tcp.md#ssl-tcp)

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/ssl-tcp.html)（原文版本：18.6；核對日期：2026-09-24）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/server-administration/runtime/ssl-tcp/ssl-server-files.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
