Repository navigation
Conversation
There was a problem hiding this comment.
This seems a bit fragile to me. Different versions could have slightly different spacing/structure. I think I would be in favor of a slightly more powerful regex taking into account just names that are unlikely to change.
I do think this feature is vital though as we will need to offer the ability to input only a CSR (no associated private key required) for launch. When we integrate it we can also try to fail gracefully if this function fails to return valid names.
|
Since this is a temporary fix, I also see the value of simply getting some functionality in... and then gracefully failing as necessary. Other thoughts? |
|
I think because this is a parser, it may be better to fail if there's unexpected input, and investigate why. I agree that there's a risk that different versions of OpenSSL may produce different amounts of indentation. In fact, I saw a bug in another program once that was based on a very similar situation (text output of OpenSSL or some similar program had different numbers of spaces in different versions). |
|
That sounds reasonable... it is probably better to be too strict than to be too liberal. Hopefully the cryptography library will come through quickly and we won't have to deal with the issue for that long. |
There was a problem hiding this comment.
this should go at the top of the module, and read import M2Crypto.X509 instead
|
IMHO this is PR is too dirty hack to be included just to satisfy the unittest and may quickly lead to falsely broken builds. :( Would we use |
|
I think we need something by launch. I have seen quite a bit of demand to not require the private key for the actual certificate. (There can be a separation between the authorized key and the private key in the certificate). By specifying just a CSR for the letsencrypt client, the private key for the certificate never has to touch the server that is getting the certificate. |
|
@jdkasten I don't really understand how private keys are related to reading of SANs from CSRs... |
|
Changes Unknown when pulling 6e0049f on get_sans into * on master*. |
|
@kuba the CSR is a very common form for tools to generate a list of what subject information they would like a cert to be issued for. All sorts of servers, appliances, and associated tools will output them in the expectation that a user can upload them to the CA and obtain a cert. In our case we no longer "upload" the CSR to a web form at the CA, but we expect that large numbers of users will still have CSRs that they generated on another machine or that another tool or device (that possesses the underlying private key that will be used to terminate TLS connections) generated. They will then want to go through the process of getting a cert on the basis of the contents of that CSR -- but possibly on a server at which the DNS name is currently pointed, which doesn't have the corresponding private TLS keys installed. One specific use case that closely relates to this is a CDN that's trying to get a cert issued for an origin server. The origin server might produce a CSR (because the server has a suite of tools that's capable of doing that) and then the CDN customer might send that CSR to the CDN. If we can import the CSR easily, we can help the CDN get the origin cert for its customer on that basis, even though the CDN doesn't know (and doesn't want to know) the private keys for its customer's origin server. |
|
So I guess a key point is that lots of prospective users, we believe, already have CSRs sitting around that related to their servers and services, and already have tools that output CSRs, and they're accustomed to using those in order to obtain certs. If we can input those and speak ACME based on the information in them, we can match and integrate well with the users' current workflow, only making this step faster, cheaper, and more automated. |
|
Thanks for your reply, @schoen. I do understand that use case. The only point that I was trying to make is that the functionality you're describing does not exists, i.e. I hope the above makes sense, although I guess you will not agree with me. I made my point already and I obviously don't want (or have power) to hold off this PR any more. It's all up to you now :) I also hope I didn't waste too much of your time. |
|
Knowing that this feature was critical for launch, I did setup the client to accept CSRs (not generate them if one is presented). The only thing that needs to be implemented is the command-line option and a graceful failure mode for name selection. I spoke with @schoen tonight and we both agree that when presenting the CSR the client must confirm the names found within it. I believe this will remove a ton of headaches possibly presented by bad parsing... but also by avoiding sys-admin errors. It is quite easy to give a wrong CSR to the program. It requires a fair amount of work (read: special openssl command) to read them and verify them from the commandline. (I was personally guilty of this earlier in the project which resulted in time spent erroneously debugging correct functionality). I will try to spend a bit more time to get random CSR samples from the Internet... (in a testing VM :)) along with generating a few myself with different commands to make sure that this doesn't trivially break. |
Conflicts: letsencrypt/client/crypto_util.py letsencrypt/client/tests/crypto_util_test.py
This is not an ideal solution for getting SANs from a CSR, but it can be used for now. There may be some parser risks in parsing the text output this way.
This also provides a way to get 100% test coverage for crypto_util.