Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
欢迎使用腾讯云开发者工具套件(SDK)3.0,SDK3.0是云 API3.0 平台的配套工具。
为方便 JAVA 开发者调试和接入腾讯云产品 API,这里向您介绍适用于 Java 的腾讯云开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯云 Java SDK 并开始调用。
# 依赖环境
1. 依赖环境:JDK 7 版本及以上。
1. 依赖环境:JDK 8 版本及以上。
2. 从 腾讯云控制台 开通相应产品。
3. 获取 SecretID、SecretKey 以及调用地址(endpoint),endpoint 一般形式为\*.tencentcloudapi.com,如CVM 的调用地址为 cvm.tencentcloudapi.com,具体参考各产品说明。

Expand Down Expand Up @@ -546,6 +546,29 @@ cpf.getHttpProfile().setHttpClient(...);

请注意,从 3.0.x 版本升级到 3.1.x 版本有兼容性问题,对于 Integer 字段的使用修改为了 Long 类型,需要重新编译项目。

## OkHttp 升级

为规避 OkHttp 3.x 版本存在的安全风险,从版本 3.2.0 起,OkHttp 依赖由 3.12.13 升级至 4.12.0。

### 回退至 OkHttp 3.12.13

若升级后与项目存在冲突,可在应用 `pom.xml` 中显式声明以下依赖进行回退。依据 Maven “路径最近优先”的依赖仲裁规则,应用声明的版本将覆盖 SDK 传递引入的 4.12.0:

```xml
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.12.13</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.12.13</version>
</dependency>
```

> **注意**:回退操作将重新引入旧版 OkHttp 已修复的安全风险,仅可用于故障应急与问题定位,问题排除后应尽快恢复使用 OkHttp 4。

## 证书问题

证书问题通常是客户端环境配置错误导致的。SDK 没有对证书进行操作,依赖的是 Java 运行环境本身的处理。出现证书问题后,可以使用`-Djavax.net.debug=ssl`开启详细日志辅助判断。
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>3.12.13</version>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
Expand All @@ -27,7 +27,7 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.12.13</version>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down Expand Up @@ -63,8 +63,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Expand Down
Loading