# HG changeset patch # User vtewari # Date 1583586320 -19800 # Node ID 7c7b1d67d6e629a8a6e1b51401f5c679ce31637a # Parent 6336cdcdcb3e26b8aad1658b5b8536cfc94acd83 8238579: HttpsURLConnection drops the timeout and hangs forever in read Summary: HttpsURLConnection drops the timeout and hangs forever in read Reviewed-by: dfuchs diff -r 6336cdcdcb3e -r 7c7b1d67d6e6 src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java --- a/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java Wed Dec 23 12:26:44 2020 +0000 +++ b/src/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java Sat Mar 07 18:35:20 2020 +0530 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, 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 @@ -93,10 +93,16 @@ */ 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(); } @@ -146,10 +152,16 @@ 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; }