Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8259582: Backout JDK-8237578 until all affected tests have been fixed
Reviewed-by: xuelei
  • Loading branch information
simonis committed Jan 11, 2021
1 parent 8dfc77b commit e9929e2b5aad12c83ca90de24ab6afab541c1c33
@@ -447,8 +447,6 @@ private void startHandshake(boolean resumable) throws IOException {
throw conContext.fatal(Alert.HANDSHAKE_FAILURE,
"Couldn't kickstart handshaking", iioe);
}
} catch (SocketException se) {
handleException(se);
} catch (IOException ioe) {
throw conContext.fatal(Alert.HANDSHAKE_FAILURE,
"Couldn't kickstart handshaking", ioe);
@@ -1413,9 +1411,6 @@ private int readHandshakeRecord() throws IOException {
} catch (InterruptedIOException iioe) {
// don't change exception in case of timeouts or interrupts
throw iioe;
} catch (SocketException se) {
// don't change exception in case of SocketException
throw se;
} catch (IOException ioe) {
throw new SSLException("readHandshakeRecord", ioe);
}
@@ -1481,9 +1476,6 @@ private ByteBuffer readApplicationRecord(
} catch (InterruptedIOException iioe) {
// don't change exception in case of timeouts or interrupts
throw iioe;
} catch (SocketException se) {
// don't change exception in case of SocketException
throw se;
} catch (IOException ioe) {
if (!(ioe instanceof SSLException)) {
throw new SSLException("readApplicationRecord", ioe);
@@ -1695,16 +1687,6 @@ private void handleException(Exception cause) throws IOException {
}
}

if (cause instanceof SocketException) {
try {
conContext.fatal(alert, cause);
} catch (Exception e) {
// Just delivering the fatal alert, re-throw the socket exception instead.
}

throw (SocketException)cause;
}

throw conContext.fatal(alert, cause);
}

@@ -28,7 +28,6 @@
import java.io.EOFException;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.SocketException;
import java.nio.ByteBuffer;
import javax.crypto.AEADBadTagException;
import javax.crypto.BadPaddingException;
@@ -141,9 +140,6 @@ static Plaintext decode(TransportContext context,
} catch (InterruptedIOException iioe) {
// don't close the Socket in case of timeouts or interrupts.
throw iioe;
} catch (SocketException se) {
// don't change exception in case of SocketException
throw se;
} catch (IOException ioe) {
throw context.fatal(Alert.UNEXPECTED_MESSAGE, ioe);
}
@@ -131,9 +131,9 @@ protected void runServerApplication(SSLSocket socket) throws Exception {
sslIS.read();
sslOS.write('A');
sslOS.flush();
} catch (SSLException | SocketException se) {
} catch (SSLException ssle) {
if (!expectFail) {
throw se;
throw ssle;
} // Otherwise, ignore.
}
}
@@ -31,18 +31,18 @@
* @bug 8214339
* @summary SSLSocketImpl erroneously wraps SocketException
* @library /javax/net/ssl/templates
* @run main/othervm SocketExceptionForSocketIssues
* @run main/othervm SSLExceptionForIOIssue
*/

import javax.net.ssl.*;
import java.io.*;
import java.net.*;

public class SocketExceptionForSocketIssues implements SSLContextTemplate {
public class SSLExceptionForIOIssue implements SSLContextTemplate {

public static void main(String[] args) throws Exception {
System.err.println("===================================");
new SocketExceptionForSocketIssues().test();
new SSLExceptionForIOIssue().test();
}

private void test() throws Exception {
@@ -79,9 +79,9 @@ private void test() throws Exception {
os.flush();
} catch (SSLProtocolException | SSLHandshakeException sslhe) {
throw sslhe;
} catch (SocketException se) {
} catch (SSLException ssle) {
// the expected exception, ignore it
System.err.println("server exception: " + se);
System.err.println("server exception: " + ssle);
} finally {
if (listenSocket != null) {
listenSocket.close();

This file was deleted.

0 comments on commit e9929e2

Please sign in to comment.