# TLS 密钥日志（TLS Key Logging）

> 使用 Proxyman 的 TLS Key Logging 记录 TLS 会话密钥并保存为文件，以便在 Wireshark 或 TCP Viewer 中解密 HTTPS 流量。

## 1. 这是什么？ {#1-whats-it}

Proxyman 可以记录 TLS 会话密钥并保存到 txt 文件中，让你在 Wireshark 或 [TCP Viewer](https://tcpviewer.proxyman.com/) 应用中解密 HTTPS 流量。

## 2. 如何使用 {#2-how-to-use-it}

1. 打开 Proxyman for macOS
2. 确保 Mac 上已安装 Proxyman 证书：打开 **Certificate** 菜单 -> **Install Certificate on this Mac…**，并按照指南操作
3. 打开 **Tools** 菜单 -> **TLS Key Logging…**
4. 勾选 **Enabled TLS Key Logging**，点击 **Select Folder…** 选择日志文件的保存位置，然后点击 **Save**

![Proxyman TLS Key Logging 面板，已启用日志记录，并选择桌面文件夹作为文件路径](https://proxyman.com/docs/assets/Screenshot%202026-09-03%20at%2012.40.51.png)

_TLS Key Logging 设置_

5. 完成。Proxyman 抓取到你的流量时，会提取 TLS 密钥并保存到日志文件中。

* 对于 iOS 设备，请按照 [ios-device.md](https://proxyman.com/docs/zh-cn/debug-devices/ios-device) 设置你的 iPhone/iPad
* 对于 Android 设备，请按照 [android-device](https://proxyman.com/docs/zh-cn/debug-devices/android-device) 操作
* 对于 Android 模拟器，请按照 [google-play-android-emulator-with-magisk.md](https://proxyman.com/docs/zh-cn/debug-devices/android-device/google-play-android-emulator-with-magisk) 操作
