Trap the RuntimeException (IllegalArgumentException) that can come from the ssl engine.  This should result in closing the connection but keeping the server up