Skip to content
Permalink
Browse files
8238579: HttpsURLConnection drops the timeout and hangs forever in read
HttpsURLConnection drops the timeout and hangs forever in read

Reviewed-by: dfuchs
  • Loading branch information
Vyom Tewari committed Mar 7, 2020
1 parent f222cb8 commit ff8e7d4087063a6d040c19079d28640993f07da8
Showing with 15 additions and 3 deletions.
  1. +15 −3 src/java.base/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -87,10 +87,16 @@ public void setNewClient (URL url)
*/
public void setNewClient (URL url, boolean useCache)
throws IOException {
int readTimeout = getReadTimeout();
http = HttpsClient.New (getSSLSocketFactory(),
url,
getHostnameVerifier(),
useCache, this);
null,
-1,
useCache,
getConnectTimeout(),
this);
http.setReadTimeout(readTimeout);
((HttpsClient)http).afterConnect();
}

@@ -132,10 +138,16 @@ protected void proxiedConnect(URL url, String proxyHost, int proxyPort,
boolean useCache) throws IOException {
if (connected)
return;
int readTimeout = getReadTimeout();
http = HttpsClient.New (getSSLSocketFactory(),
url,
getHostnameVerifier(),
proxyHost, proxyPort, useCache, this);
proxyHost,
proxyPort,
useCache,
getConnectTimeout(),
this);
http.setReadTimeout(readTimeout);
connected = true;
}

0 comments on commit ff8e7d4

Please sign in to comment.