> 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/client-authentication/auth-cert.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 20.12. 憑證驗證

### 20.12. 憑證驗證 [#](#auth-cert) <a href="#auth-cert" id="auth-cert"></a>

此驗證方法使用 SSL 用戶端憑證執行驗證，因此僅適用於 SSL 連線；SSL 設定指示請參閱 [第 18.9.2 節](https://docs.postgresql.tw/19/server-administration/runtime/ssl-tcp.md#ssl-openssl-config)。使用此驗證方法時，伺服器會要求 用戶端提供有效且受信任的憑證，且不會向用戶端提示輸入密碼。憑證的 `cn`（Common Name） 屬性會與所要求的資料庫使用者名稱比較；若兩者相符，便允許登入。可使用使用者名稱對應， 使 `cn` 與資料庫使用者名稱不同。

SSL 憑證驗證支援下列設定選項：

`map` : 允許在系統與資料庫使用者名稱之間建立對應。詳細資訊請參閱 [第 20.2 節](https://docs.postgresql.tw/19/server-administration/client-authentication/auth-username-maps.md)。

將 `clientcert` 選項與 `cert` 驗證併用是多餘的，因為 `cert` 驗證實際上等同於 設定 `clientcert=verify-full` 的 `trust` 驗證。

***

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


---

# 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/client-authentication/auth-cert.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.
