diff --git a/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java b/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java index 5532948bc18..75933d5596e 100644 --- a/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java +++ b/spdy-jetty/src/main/java/org/eclipse/jetty/spdy/SPDYAsyncConnection.java @@ -177,21 +177,20 @@ public class SPDYAsyncConnection extends AbstractConnection implements AsyncConn try { AsyncEndPoint endPoint = getEndPoint(); - if (onlyOutput) + try { - try - { - logger.debug("Shutting down output {}", endPoint); - endPoint.shutdownOutput(); - } - catch (IOException x) + // We need to gently close first, to allow + // SSL close alerts to be sent by Jetty + logger.debug("Shutting down output {}", endPoint); + endPoint.shutdownOutput(); + if (!onlyOutput) { + logger.debug("Closing {}", endPoint); endPoint.close(); } } - else + catch (IOException x) { - logger.debug("Closing {}", endPoint); endPoint.close(); } }