Blog
首页
文档
收藏
关于
  • 在线转换时间戳 (opens new window)
  • 在线压缩图片 (opens new window)
  • Float-Double转二进制 (opens new window)
  • 文件转Hex字符串 (opens new window)

HiuZing

🍑
首页
文档
收藏
关于
  • 在线转换时间戳 (opens new window)
  • 在线压缩图片 (opens new window)
  • Float-Double转二进制 (opens new window)
  • 文件转Hex字符串 (opens new window)
  • Charles

    • Charles使用
      • 简介
        • 原理
        • 步骤
        • 功能
      • 安装
      • 设置
  • 测试用例

  • 测试
  • Charles
HiuZing
2023-09-30
目录

Charles使用

# 简介

# 原理

image-20230930221350903

# 步骤

# 前置步骤

  1. 需要运行Charles并配置代理
  2. 在客户端上面需要配置代理

# 步骤

  1. 由客户端发送请求
  2. Charles接收再发送给服务端
  3. 服务端返回请求结果给Charles
  4. 由Charles转发给客户端

# 功能

  1. 支持HTTP以及HTTPS代理
  2. 支持流量控制
  3. 支持接口并发请求
  4. 支持重发网络请求
  5. 支持断点调试

# 安装

  1. 下载

    Download a Free Trial of Charles • Charles Web Debugging Proxy (charlesproxy.com) (opens new window)

# 设置

  1. 主页面

    image-20230930233536540

  2. 代理设置

    image-20230930233457778

  3. 添加端口

  4. 下载证书

    • Help ---> SSl Proxying ---> install charles root certificate ---> 安装证书
    • 设置SSL属性:Proxy ---> SSL Proxy Settings ---> 然后add操作(设置port为443和*)。
  5. 在Help-Local IP Address获取本机IP地址,在手机WiFi设置代理配置IP地址,配置完成后,会看到一个charles与手机端的连接提示弹窗选择允许。

  6. 在Help->Install Charles Root Certificate on a Mobile Device or Remote Browser下载证书

    1. 打开浏览器,输入:chls.pro/ssl,就会自己下载到手机上,这里需要记住下载完成保存到本地的路径。
    2. 设置 ---> 更多设置 ---> 系统安全 ---> 加密与凭据 ---> 从SD卡安装,选择之前保存证书的路径。注意,有的手机是直接点击下载的文件即可安装……
  7. Android项目代码设置兼容

    报错:java.security.cert.CertPathValidatorException: Trust anchor for certification path not found

    解决:添加安全配置文件

    <?xml version="1.0" encoding="utf-8"?>
    <network-security-config>
        <base-config cleartextTrafficPermitted="true">
            <trust-anchors>
                <certificates
                    overridePins="true"
                    src="system" />
                <certificates
                    overridePins="true"
                    src="user" />
            </trust-anchors>
        </base-config>
    </network-security-config>
    
    //清单文件配置
    <application
        android:networkSecurityConfig="@xml/network_security_config_debug">
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
上次更新: 2024/08/14, 04:14:33
黑盒测试

黑盒测试→

最近更新
01
React Native 使用SVG
08-13
02
Docker基础命令
08-04
03
算数逻辑单元
07-30
更多文章>
Theme by Vdoing | Copyright © 2021-2024 WeiXiaojing | 友情链接
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式