uni-app targetSdk36 安卓15 请求返回"protocol TLSv1 is not supported"

uni-app targetSdk36 安卓15 请求返回"protocol TLSv1 is not supported"

开发环境 版本号 项目创建方式
Mac 4.82.2025093004-alpha CLI
### 操作步骤:
### 预期结果:
### 实际结果:

bug描述:

所有请求都返回 {"errMsg":"request:fail abort statusCode:-1 protocol TLSv1 is not supported"}

更多关于uni-app targetSdk36 安卓15 请求返回"protocol TLSv1 is not supported"的实战教程也可以访问 https://www.itying.com/category-93-b0.html

1 回复

更多关于uni-app targetSdk36 安卓15 请求返回"protocol TLSv1 is not supported"的实战教程也可以访问 https://www.itying.com/category-93-b0.html


这是一个典型的TLS协议兼容性问题。在Android 15(API 36)中,系统默认禁用了较旧的TLSv1协议,强制要求使用更安全的TLSv1.2或更高版本。

解决方案:

  1. 检查服务器配置:确保你的后端服务器支持TLSv1.2或更高版本。这是根本原因,服务器必须升级TLS协议。

  2. uni-app网络配置:在manifest.json中配置网络安全策略:

{
    "app-plus": {
        "networkSecurity": {
            "cleartextTraffic": true
        }
    }
}
  1. Android配置:在manifest.json的Android配置节点中添加:
{
    "app-plus": {
        "android": {
            "targetSdkVersion": 36,
            "usesCleartextTraffic": true
        }
    }
}
回到顶部