Skip to content

Commit

Permalink
up hc
Browse files Browse the repository at this point in the history
  • Loading branch information
youfanx committed Jul 2, 2024
1 parent b6ff95e commit b35d30a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions rxlib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<commons-lang3.version>3.14.0</commons-lang3.version>
<commons-collections4.version>4.4</commons-collections4.version>
<commons-io.version>2.13.0</commons-io.version>
<byte-buddy.version>1.14.16</byte-buddy.version>
<byte-buddy.version>1.14.17</byte-buddy.version>
<zip4j.version>2.11.3</zip4j.version>
<h2.version>2.2.224</h2.version>
<netty.version>4.1.111.Final</netty.version>
<bcprov.version>1.78.1</bcprov.version>
<okhttp.version>4.12.0</okhttp.version>
<sshd.version>2.12.1</sshd.version>
<sshd.version>2.13.1</sshd.version>
<jsch.version>0.1.55</jsch.version>

<spring.boot.version>2.5.15</spring.boot.version>
Expand Down
9 changes: 7 additions & 2 deletions rxlib/src/main/java/org/rx/net/http/HttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,13 @@ static OkHttpClient createClient(long connectTimeoutMillis, long readWriteTimeou
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, new TrustManager[]{TRUST_MANAGER}, new SecureRandom());
Authenticator authenticator = proxy instanceof AuthenticProxy ? ((AuthenticProxy) proxy).getAuthenticator() : Authenticator.NONE;
OkHttpClient.Builder builder = new OkHttpClient.Builder().sslSocketFactory(sslContext.getSocketFactory(), TRUST_MANAGER).hostnameVerifier((s, sslSession) -> true).connectionPool(POOL).retryOnConnectionFailure(true) //unexpected end of stream
.connectTimeout(connectTimeoutMillis, TimeUnit.MILLISECONDS).readTimeout(readWriteTimeoutMillis, TimeUnit.MILLISECONDS).writeTimeout(readWriteTimeoutMillis, TimeUnit.MILLISECONDS).proxy(proxy).proxyAuthenticator(authenticator);
OkHttpClient.Builder builder = new OkHttpClient.Builder().sslSocketFactory(sslContext.getSocketFactory(), TRUST_MANAGER).hostnameVerifier((s, sslSession) -> true)
.connectionPool(POOL).retryOnConnectionFailure(true) //unexpected end of stream
.connectTimeout(connectTimeoutMillis, TimeUnit.MILLISECONDS)
.readTimeout(readWriteTimeoutMillis, TimeUnit.MILLISECONDS)
.writeTimeout(readWriteTimeoutMillis, TimeUnit.MILLISECONDS)
.callTimeout(readWriteTimeoutMillis * 2, TimeUnit.MILLISECONDS)
.proxy(proxy).proxyAuthenticator(authenticator);
if (enableCookie) {
builder.cookieJar(COOKIES);
}
Expand Down

0 comments on commit b35d30a

Please sign in to comment.