Commit 3e4392a4 authored by Guus der Kinderen's avatar Guus der Kinderen

OF-793: Don't send data upon STARTTLS Negotiation failure.

parent c2740984
...@@ -331,19 +331,22 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou ...@@ -331,19 +331,22 @@ public class LocalOutgoingServerSession extends LocalServerSession implements Ou
connection.close(); connection.close();
} }
} }
catch (SSLHandshakeException e) { catch (SSLHandshakeException e)
Log.debug("LocalOutgoingServerSession: Handshake error while creating secured outgoing session to remote " + {
"server: " + hostname + "(DNS lookup: " + realHostname + ":" + realPort + // This is a failure as described in RFC3620, section 5.4.3.2 "STARTTLS Failure".
"):", e); Log.info( "STARTTLS negotiation (with {} at {}:{}) failed.", hostname, realHostname, realPort, e );
// Close the connection
// The receiving entity is expected to close the socket *without* sending any more data (<failure/> nor </stream>).
// It is probably (see OF-794) best if we, as the initiating entity, therefor don't send any data either.
if (connection != null) { if (connection != null) {
connection.close(); connection.forceClose();
} }
} }
catch (Exception e) { catch (Exception e)
Log.error("Error creating secured outgoing session to remote server: " + hostname + {
"(DNS lookup: " + realHostname + ":" + realPort + ")", e); // This might be RFC3620, section 5.4.2.2 "Failure Case" or even an unrelated problem. Handle 'normally'.
// Close the connection Log.warn( "An exception occurred while creating an encrypted session (with {} at {}:{})", hostname, realHostname, realPort, e );
if (connection != null) { if (connection != null) {
connection.close(); connection.close();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment