Repository navigation
RPC Fix and Issue #202: OCSP Update Tool - #247
Conversation
- First steps towards ocsp updater. - Move the type converter into its own file in "sa" rather than core, to keep Gorp from leaking out of the SA package.
- Move dbMap construction and type converter into individual files in the sa package.
- Add DB configuration for the OCSP tool to the boulder config:
- left to the user if they want to use different boulder-config.json files
for different purposes.
- Added updater to Makefile
- Fix trailing ',' in the Boulder config, add more panic logging
- Ignore .pem files produced by the integration test
- Change RPC to use per-instance named reply-to queues.
- Finish OCSP Updater logic
- Rework RPC for OCSP to use a transfer object (due to serialization problems of x509.Certificate)
- Fix a bunch of typos in rpc-wrappers.go - Unblank `id` in core.Registration JSON: - It's not spec, but it's not hurting anything, and we reveal it to clients anyway. - We need knowledge of the ID in RPC, so if we don't want to include this in the object, we need to make a transfer object to wrap it. - Make the RPC logs much clearer as to who's talking to who - Typo in WFE where we called a registration an authz
4841920 to
e4e52e7
Compare
- Implement MethodUpdateRegistration - Add error logging to a lot of places it was missing - Consolidate RevokeCertificate; we're doing it elsewhere anyway - Fix erronous returns on RPC failures in several places
|
Retriggered; Travis' error was that "colors.js" wasn't available to the integration test. Probably a platform issue? |
- NewPendingAuthorization now uses a core.Authorization object, so that foreign key constraints are followed - core.Authorization now serializes RegistrationID to JSON, so it has to get blanked out in WFE before transmission to client. - Remove ParsedCertificate from core.Certificate, as type x509.Certificate cannot be marshaled. - Added AssertDeepEquals and AssertMarhsaledEquals to test-tools.go - Caught several overloaded and misleadingly named errors in WFE
|
That "colors.js not available" issue is because I forgot to copy the |
Issue #239 - Add a build ID method to WFE, and print Info on startup …
There was a problem hiding this comment.
This should really be in NewDbMap, I think, along with all of the other AddTables. Otherwise it's likely that these will drift out of sync in subtle ways.
There was a problem hiding this comment.
Moved the initTables method into database.go and made it always run on a DbMap. This may require some further work when we use a disjoint schema, like that for certificate-authority-data.go.
There was a problem hiding this comment.
This comment no longer makes sense in this context.
There was a problem hiding this comment.
I think this line can now be deleted.
|
Done reviewing. Generally looks great! Nice work. |
There was a problem hiding this comment.
You're going to make way more OCSP responses than you need to with this query. You should only be generating OCSP information for certificates that are not expired. I think we need to add a "notAfter" column to the certificateStatus table, so that we can select on that here. I'm not sure how to add a commit to this PR, but here's a micro-patch in an ad-hoc format:
core/objects.go: type CertificateStatus struct {
+ // notAfter: The notAfter time of the certificate. This is simply copied
+ // from the certificate itself, but simplifies queries needed to make CSRs
+ // and OCSP responses
+ NotAfter time.Time `db:"notAfter"`
sa/storage-authority.go: AddCertificate(
Serial: serial,
+ NotAfter: parsedCertificate.NotAfter,
RevokedDate: time.Time{},
If you make that change, then it seems like you should be able to just add a clause to that SELECT statement of the form:
cs.notAfter > ?
... where the ? is populated with something like time.Now().
There was a problem hiding this comment.
Let's do this in another patch. I actually want to put that into the Certificates table, as it belongs to the cert, and just join it in.
I actually was thinking that, which is why I went ahead to write the query with an AS cs to prep the join, but I think I fell asleep somewhere around then.
I opened Issue #254 to track this.
RPC Fix and Issue #202: OCSP Update Tool
This PR primarily resolves an error in the use of our RPC layer, that duplication of reply-to addresses caused indeterminate behavior when using AMQP due to a race condition as to which client would consume the message first. The intention was for the client topics to uniquely identify a particular instance.
Due to this being discovered while writing the OCSP Update Tool (which requires AMQP RPC), the RPC work bled into the OCSP Update Tool's PR. I apologize in advance for the murkiness, but hopefully it's clear what was going on.
Note that there are still outstanding issues with the OCSP Responder in this commit; it requires some additional work before OCSP is complete.
Notes:
sapackage.boulder-config.jsonfiles for different purposes..pemfiles produced by the integration testshell.goto modify thecmd.Configobject based on custom CLI flags; seecmd/ocsp-updater/main.gofor an example.x509.Certificatethat foreign key constraints are followed
blanked out in WFE before transmission to client.
be marshaled.