< prev index next >
test/sun/security/ssl/SSLSocketImpl/SSLExceptionForIOIssue.java
Print this page
rev 14406 : 8239798: SSLSocket closes socket both socket endpoints on a SocketTimeoutException
Reviewed-by: xuelei
Contributed-by: alexey@azul.com verghese@amazon.com
@@ -34,11 +34,11 @@
* @run main/othervm SSLExceptionForIOIssue
*/
import javax.net.ssl.*;
import java.io.*;
-import java.net.InetAddress;
+import java.net.*;
public class SSLExceptionForIOIssue implements SSLContextTemplate {
public static void main(String[] args) throws Exception {
System.err.println("===================================");
@@ -137,11 +137,11 @@
String data = is.readLine();
System.err.println("Received Data from server: " + data);
} catch (SSLProtocolException | SSLHandshakeException sslhe) {
clientException = sslhe;
System.err.println("unexpected client exception: " + sslhe);
- } catch (SSLException ssle) {
+ } catch (SSLException | SocketTimeoutException ssle) {
// the expected exception, ignore it
System.err.println("expected client exception: " + ssle);
} catch (Exception e) {
clientException = e;
System.err.println("unexpected client exception: " + e);
< prev index next >