# 服务器证书

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com.cn/help/idea/llms.txt).

> **TL;DR**
> `文件 | 设置 | 外观&行为 | 系统设置 | 服务器证书`  适用于 Windows 和 Linux
>
>
>
> `%instance% | 设置 | 外观&行为 | 系统设置 | 服务器证书`  适用于 macOS
>
>
>
> `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS)) !["设置"图标](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.expui.general.settings.svg)

IntelliJ IDEA 提供其自己存储的受信任证书。

服务器证书用于为您可能已在 IDE 中配置的各种工具和服务建立安全连接。 这些证书会影响 Gradle 和 Maven 等工具，以及远程部署服务器和使用 HTTPS 的 web 服务或 API。 添加受信任的证书可确保这些工具和服务信任指定的证书。

IntelliJ IDEA 运行的 Git 命令行工具不会使用这些证书，而是依赖自身的证书配置。 在 Windows 上，可以让 Git 使用 Windows 证书存储：在  `设置 | 高级设置`  中，选择   使用 Windows 证书存储  。

IntelliJ IDEA 通过 JDK 的默认信任库（  `cacerts` ）信任服务器证书，该信任库包含知名的根证书颁发机构。 如果证书不在其中，可以将其添加到 IntelliJ IDEA 自身的信任存储（仅影响IDE），或添加到 JDK 信任存储（影响使用该 JDK 的所有 Java 应用，包括 Gradle 和 Maven）。

![设置中的服务器证书页面](https://resources.jetbrains.com.cn/help/img/idea/2026.3/server_certificates.png)

|  条目  |  快捷键  |  描述  |
| --- | --- | --- |
|  自动接受不受信任的证书  |  |  选择此选项，如果您希望非受信任证书（即未添加到列表中的证书）被自动接受，而无需向服务器发送请求。  |
|  ![添加](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.expui.general.add.svg)  |  `Alt+Insert` (Windows), `⌘ N` (macOS), `⌃ N` (IntelliJ IDEA Classic (macOS)), `⌘ N` (macOS System Shortcuts), `Alt+Insert` (XWin), `Alt+Insert` (GNOME), `Alt+Insert` (KDE), `Alt+Insert` (Emacs), `Alt+Insert` (Sublime Text), `⌘ N` (Sublime Text (macOS)), `Alt+Insert` (Visual Studio), `⌘ ⌃ N` (Visual Studio (macOS)), `Alt+Insert` (NetBeans), `Alt+Insert` (Eclipse), `⌘ N` (Eclipse (macOS))  |     将受信任的服务器证书添加到列表，例如公司或内部证书颁发机构的根证书。 在打开的对话框中选择证书文件。       证书文件应具有  `.crt` 、  `.cer`  或  `.pem`  扩展名。       对于受信任的证书，证书信息显示在页面的下部。     |
|  ![移除](https://resources.jetbrains.com.cn/help/img/idea/2026.3/app.expui.general.remove.svg)  |  `Alt+Delete` (Windows), `⌘ ⌦` (macOS), `⌘ ⌦` (IntelliJ IDEA Classic (macOS)), `⌘ ⌦` (macOS System Shortcuts), `Alt+Delete` (XWin), `Alt+Delete` (GNOME), `Alt+Delete` (KDE), `Alt+Delete` (Emacs), `Alt+Delete` (Sublime Text), `⌘ ⌦` (Sublime Text (macOS)), `Ctrl+R, D` (Visual Studio), `⌘ R, D` (Visual Studio (macOS)), `Alt+Delete` (NetBeans), `Alt+Delete` (Eclipse), `Alt+Delete` (Eclipse (macOS))  |  从列表中移除已选择的受信任证书。  |

已添加证书的信息存储在  `ssl/cacerts`  中，位于 IDE [配置目录](directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory)内。

> **Tip:**
> 了解有关 [受信任的根证书](ssl-certificates.html) 的更多信息，它们定义了在安全（HTTPS/SSL/TLS）通信期间可以信任哪些服务器。

## 不受信任的服务器证书

IntelliJ IDEA 在连接到不信任的服务时会显示   不受信任的服务器证书   警告。

请从 YouTrack 中的 [支持知识库](https://youtrack.jetbrains.com/articles/SUPPORT-A-1939)详细了解可能的原因和解决方案。

![不受信任的服务器证书对话框](https://resources.jetbrains.com.cn/help/img/idea/2026.3/untrusted_certificate.png)

## See also

### 参考

### 过程

[受信任的根证书](ssl-certificates.html) [HTTP 客户端](http-client-in-product-code-editor.html)

