Skip to content

Standalone authenticator - #232

Merged
schoen merged 50 commits into
masterfrom
standalone_authenticator
Feb 11, 2015
Merged

schoen merged 50 commits into
masterfrom
standalone_authenticator

Conversation

@schoen

@schoen schoen commented Feb 6, 2015

Copy link
Copy Markdown
Contributor

This branch implements a standalone authenticator, part of the so-called standalone configurator or null configurator functionality. The authenticator uses the plugin API and can start a TCP listener to complete DVSNI challenges without the use of a web server.

There are unit tests for all functions, including some functions that are not currently called, with pretty complete code coverage (a few failure cases are not yet tested). We also found that this can be substituted in place of the Apache configurator's authenticator, and we do get all the way to certificate issuance and deployment.

There is currently no way to choose to use the standalone authenticator from inside of the user interface (or at all). James and I have been talking about this; there will need to be UI changes in the main LE client in order to be able to choose this instead of the Apache configurator and perhaps ultimately to detect automatically which configurator ought to be used.

Two things for discussion, which don't necessarily need to be resolved prior to merging:

  • The strategy of spawning a subprocess for the listener and doing minimal IPC with Unix signals. This doesn't give particularly rich error reporting if something goes wrong with the listener process.
  • The "abbreviated DVSNI" functionality (implementing a small subset of TLS messages manually in order to complete only the part of the TLS handshake that is used by DVSNI, and not expecting or requiring to complete the handshake all the way to Finished, instead disconnecting once the DVSNI certificate has been offered and received). Right now there is a complete and working abbreviated abbreviated DVSNI implementation but it doesn't interoperate with the Node server, which expects to complete the TLS handshake when verifying a proof. So the abbreviate DVSNI logic is commented out and the listener instead currently uses the PyOpenSSL binding to perform a TLS handshake.

Choosing to use abbreviated DVSNI would require making changes on the verifier side too (for interoperability), as well as a judgment that this is indeed safer than using bindings for full-fledged TLS libraries on both sides.

@kuba

kuba commented Feb 6, 2015

Copy link
Copy Markdown
Contributor

@schoen, could you please fix all of the build errors? Thanks!

Since Travis CI has been moody recently, it's best to run the tests locally, using tox. More info: http://letsencrypt.readthedocs.org/en/latest/project.html

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docstring: split out one-liner

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could fit it in much less space using hanigng indent

@schoen

schoen commented Feb 11, 2015

Copy link
Copy Markdown
Contributor Author

I think I've considered all of @kuba's comments, we pass all the tests, and @jdkasten just tried hooking this up to the client and got all the way to a successful cert issuance, so we're planning to merge this.

schoen added a commit that referenced this pull request Feb 11, 2015
@schoen
schoen merged commit b80ac49 into master Feb 11, 2015
@schoen
schoen deleted the standalone_authenticator branch February 11, 2015 02:02
@kuba

kuba commented Feb 11, 2015

Copy link
Copy Markdown
Contributor

@schoen Have you considered what I said (#letsencrypt) about forking, threads and signals?

kuba added a commit to kuba/letsencrypt that referenced this pull request Feb 11, 2015
@schoen

schoen commented Feb 11, 2015

Copy link
Copy Markdown
Contributor Author

Oh, I hadn't read the channel recently, so I didn't see that. Thanks for pointing it out!

I also suspect that threads might be a simpler and more elegant way to do this because we can get updating of variables for free as a simple way to communicate between threads. I was originally planning to use threads but @pde described some quite severe performance problems in a prior project that used Python threads for a network server.

It's possible that the scale and setting of this server are such that those problems wouldn't apply to us. If anyone rewrites this using threads, I'm happy to test it, and I'll definitely consider doing so myself as well. I think I'll have to work on a few other things on the client before returning to this topic, though.

I did notice that the signal handler in the parent process affects the behavior of the client, and I have a TODO note on that (we should set the signal handler back to SIG_DFL in the parent process as soon as we believe or know that the child has exited). We could raise it to the level of an issue in the issue tracker, but it's probably just like 4 lines of code to fix it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants