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 @@ -5,7 +5,7 @@ Welcome to Tencent Cloud Software Development Kit (SDK), a companion tool for th
Tencent Cloud SDK for Java helps Java developers debug and use TencentCloud APIs with ease. This document describes Tencent Cloud SDK for Java and how to quickly use it with code examples provided.

# Dependent Environment
1. Dependent environment: JDK 7 or higher.
1. Dependent environment: JDK 8 or higher.
2. Activate your product in the Tencent Cloud Console.
3. Get the `SecretID`, `SecretKey`, and endpoint. The general format of endpoint is `\*.intl.tencentcloudapi.com`. For example, the endpoint of CVM is `cvm.intl.tencentcloudapi.com`. For more information, please see the documentation of the specified product.

Expand Down Expand Up @@ -197,6 +197,29 @@ request.setHeader(header);
```
Example: [CustomHttpClient.java](examples/common/CustomHttpClient.java).

# OkHttp Upgrade

To mitigate security risks in OkHttp 3.x, starting from version 3.2.0, the OkHttp dependency is upgraded from 3.12.13 to 4.12.0.

### Roll back to OkHttp 3.12.13

If the upgrade conflicts with your project, you can explicitly declare the following dependencies in your application's `pom.xml` to roll back. Per Maven's "nearest definition" dependency mediation rule, the version declared by the application will override the 4.12.0 transitively introduced by the SDK:

```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>
```

> **Note**: Rolling back will reintroduce the security risks fixed in newer OkHttp versions. Use it only for emergency troubleshooting and issue diagnosis, and restore OkHttp 4 as soon as the issue is resolved.

# Other Issues

## Certificate Problems
Expand Down
24 changes: 10 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<packaging>jar</packaging>
<name>tencentcloud-sdk-java-intl-en</name>
<url>https://cloud.tencent.com/</url>
<description>Tencent Cloud API SDK for Java</description>
<description>Tencent Cloud Open API SDK for Java</description>
<dependencies>
<dependency>
<groupId>commons-logging</groupId>
Expand All @@ -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,24 +27,19 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.12.13</version>
<version>4.12.0</version>
</dependency>
<dependency>
<groupId>org.ini4j</groupId>
<artifactId>ini4j</artifactId>
<version>0.5.4</version>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.12.0</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tencentcloudapi</groupId>
<artifactId>tencentcloud-sdk-java-common</artifactId>
<version>3.1.924</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand All @@ -68,8 +63,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>7</source>
<target>7</target>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Expand All @@ -79,7 +74,7 @@
<version>2.3.2</version>
<configuration>
<excludes>
</excludes>
</excludes>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -154,3 +149,4 @@
</snapshotRepository>
</distributionManagement>
</project>

Loading