New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor plugins/tls a little #1670

Merged
merged 3 commits into from Oct 18, 2016

Conversation

Projects
None yet
2 participants
@msimerson
Member

msimerson commented Oct 16, 2016

Changes proposed in this pull request:

  • move the tls_opts loading to its own function (it's grown quite a lot)
    • with test coverage
  • add load_err(), to reduce redundancy
  • give the hook functions better names:
    • tls_capabilities -> advertise_starttls
    • tls_unrecognized_command -> upgrade_connection
  • within upgrade_connection, consolidate the two timeout functions into nextOnce()
  • refactor the loginfo ternary into emit_upgrade_msg() with test coverage
  • add additional tls options to tls.ini (as comments)

Checklist:

  • tests updated
@typingArtist

Please consider msimerson/Haraka#6, it avoids the nasty error messages.

For the rest of the changes: The better abstraction in plugin/tls.js looks really nice. However, I am no node pro for signing off the whole set of changes.

}
connection.notes.tls_timer = timer;
connection.notes.cleanUpDisconnect = cleanUpDisconnect;
connection.notes.cleanUpDisconnect = nextOnce;

This comment has been minimized.

@typingArtist

typingArtist Oct 17, 2016

Collaborator

If disconnect calls back, we will see an error. I don’t think that is right, first because we already get log entries about terminated connection, second because it’s not a timeout error.

@typingArtist

typingArtist Oct 17, 2016

Collaborator

If disconnect calls back, we will see an error. I don’t think that is right, first because we already get log entries about terminated connection, second because it’s not a timeout error.

msimerson and others added some commits Oct 16, 2016

tls refactor
* test coverage for log message
* add new commented options to tls.ini file
* add test tls.ini
remove node 0.7 net.connect syntax
* and better error message
@msimerson

This comment has been minimized.

Show comment
Hide comment
@msimerson

msimerson Oct 17, 2016

Member

The better abstraction in plugin/tls.js looks really nice

Thanks. I've deployed this into production to watch it for a couple days and make sure I didn't mess anything up too badly. It would't hurt if you did so too. :-)

Also, thanks for the ssltest.sh script reference, that's a nice handy way to give those TLS underpinnings a workout.

Member

msimerson commented Oct 17, 2016

The better abstraction in plugin/tls.js looks really nice

Thanks. I've deployed this into production to watch it for a couple days and make sure I didn't mess anything up too badly. It would't hurt if you did so too. :-)

Also, thanks for the ssltest.sh script reference, that's a nice handy way to give those TLS underpinnings a workout.

@msimerson msimerson merged commit b27008f into haraka:master Oct 18, 2016

1 of 3 checks passed

codecov/patch 0.00% of diff hit (target 35.89%)
Details
codecov/project 35.89% (-0.01%) compared to 4883c08
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@msimerson msimerson deleted the msimerson:tls-refactor branch Oct 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment