Commit Graph

3879 Commits

Author SHA1 Message Date
Daniel McCarney ca3a2e0e3c Update publicsuffix-go to `fb1fc94` (#2642)
This PR updates the `publicsuffix-go` dependency to `fb1fc94`, the
latest autopull and the HEAD of master at the time of writing.

Per CONTRIBUTING.md the tests were verified to pass:
```
?       github.com/weppos/publicsuffix-go/cmd/load      [no test files]
ok      github.com/weppos/publicsuffix-go/net/publicsuffix      0.007s
ok      github.com/weppos/publicsuffix-go/publicsuffix  0.027s

```
2017-04-03 12:23:29 -07:00
Roland Bracewell Shoemaker 08f4dda038 Update github.com/grpc-ecosystem/go-grpc-prometheus and google.golang.org/grpc (#2637)
Updates the various gRPC/protobuf libs (google.golang.org/grpc/... and github.com/golang/protobuf/proto) and the boulder-tools image so that we can update to the newest github.com/grpc-ecosystem/go-grpc-prometheus. Also regenerates all of the protobuf definition files.

Tests run on updated packages all pass.

Unblocks #2633 fixes #2636.
2017-04-03 11:13:48 -07:00
Daniel McCarney dce2b12c7f Merge pull request #2641 from letsencrypt/master
Merge master to staging
2017-04-03 11:36:45 -04:00
Jacob Hoffman-Andrews 6719dc17a6 Remove AMQP config and code (#2634)
We now use gRPC everywhere.
2017-04-03 10:39:39 -04:00
Roland Bracewell Shoemaker 98addd5f36 expiration-mailer daemon mode (#2631)
Adds a daemon mode to `expiration-mailer` that is triggered by using the flag `--daemon` in order to follow deployability guidelines. If the `--daemon` flag is used the `mailer.runPeriod` config field is checked for a tick duration, if the value is `0` it exits.

Super lightweight implementation, OCSP-Updater has some custom ticker code which we use to do fancy things when the method being invoked in the loop takes longer expected, but that isn't necessary here.

Fixes #2617.
2017-03-30 16:16:41 -07:00
Roland Bracewell Shoemaker cefb153ea7 Fix missing berrors.InvalidEmail -> probs.ProblemDetails mapping (#2630)
This fixes an issue caused by #2583. Prior to that PR, we would serve the "invalidEmail" problem type when a DNS lookup for an email base domain failed. After that PR, we would map "berrors.InvalidEmail" to the "InternalServerError" problem type, which caused 500 errors to be returned to the user.

This PR restores the behavior of returning "type": "...invalidEmail" to the user.
2017-03-29 15:31:33 -07:00
Daniel McCarney b8319e7fa3 Merge pull request #2626 from letsencrypt/master
Merge master to staging
2017-03-27 11:21:30 -04:00
Roland Bracewell Shoemaker acbd9ed3a7 Purge both pending and finalized authorizations as well as challenges (#2149)
Fixes #2148.

Instead of just doing a blanket `DELETE FROM ...` this changes the `expired-authz-purger` to select all of the expired IDs (for both pending and finalized authorizations) then loop over them deleting each and its associated challenges from their respective tables.

Local testing indicates the performance of this is not awful but we should do a test run on staging to verify. If it ends up taking way too long to run there the easiest optimization would be to turn the slice of IDs into a channel and run multiple workers looping over the channel deleting stuff instead of just a single one.

Makes a few small integration test changes in order to facilitate deleting both pending and finalized authorizations.
2017-03-24 11:04:35 -07:00
Roland Bracewell Shoemaker e2b2511898 Overhaul internal error usage (#2583)
This patch removes all usages of the `core.XXXError` and almost all usages of `probs` outside of the WFE and VA and replaces them with a unified internal error type. Since the VA uses `probs.ProblemDetails` quite extensively in challenges, and currently stores them in the DB I've saved this change for another change (it'll also require a migration). Since `ProblemDetails` should only ever be exposed to end-users all of its related logic should be moved into the `WFE` but since it still needs to be exposed to the VA and SA I've left it in place for now.

The new internal `errors` package offers the same convenience functions as `probs` does as well as a new simpler type testing method. A few small changes have also been made to error messages, mainly adding the library and function name to internal server errors for easier debugging (i.e. where a number of functions return the exact same errors and there is no other way to distinguish which method threw the error).

Also adds proper encoding of internal errors transferred over gRPC (the current encoding scheme is kept for `core` and `probs` errors since it'll be ideally be removed after we deploy this and follow-up changes) using `grpc/metadata` instead of the gRPC status codes.

Fixes #2507. Updates #2254 and #2505.
2017-03-22 23:27:31 -07:00
Roland Bracewell Shoemaker 194a55d7c7 Remove RabbitMQ + AMQP references from README (#2616)
Fixes #2407.
2017-03-22 12:43:43 -07:00
David Calavera c71c3cff80 Implement TLS-SNI-02 challenge validations. (#2585)
I think these are all the necessary changes to implement TLS-SNI-02 validations, according to the section 7.3 of draft 05:

https://tools.ietf.org/html/draft-ietf-acme-acme-05#section-7.3

I don't have much experience with this code, I'll really appreciate your feedback.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-03-22 10:17:59 -07:00
Daniel McCarney 8f1de3b57e Allows expiration-mailer to use template as subject. (#2613)
This commit resolves #2599 by adding support to the expiration-mailer to
treat the subject for email messages as a template. This allows for the
dynamic subject lines from #2435 to be used with a prefix for staging
emails.
2017-03-21 16:57:28 -07:00
Daniel McCarney 3d75161b83 Merge pull request #2612 from letsencrypt/master
Merge master to staging.
2017-03-20 12:54:06 -04:00
Daniel McCarney 2114596e58 Workaround #2610 for flaky ct submission test. (#2611)
Presently the CA and the ocsp-updater can race on the initial
submission of a certificate to the configured logs. This results
in double submitting certificates. In integration tests with the fake CT
server this manifests as an occasional failure of the
`test_ct_submission` test (Issue #2579).

The race we currently experience is expected to be fixed in
the future by a planned redesign so for now this commit works around the
failure by allowing either the expected number of submissions, or
exactly double the expected. This fixes #2579. The need to fix the
underlying race was captured in #2610.

The workaround was verified by submitting 10 builds to travis, all
succeeded.
2017-03-20 09:03:54 -04:00
Daniel McCarney f46dc9307f Merge pull request #2604 from letsencrypt/master
Merge master to staging.
2017-03-13 14:16:45 -04:00
Daniel McCarney e81f7477a3 Fixes outdated IPv6 TODO on `getAddr`. (#2601)
The VA's `getAddr` function prior to this commit had an outdated comment
& a pointer to a TODO for Boulder Issue #593. That issue has been closed
and bdns' `LookupHost` supports AAAA records now. This commit updates
the comment to match the current behaviour and removes the TODO.
2017-03-09 13:20:03 -05:00
Roland Bracewell Shoemaker 8a1adbdc9a Switch to gorp.v2 (#2598)
Switch from `gorp.v1` to `gorp.v2`. Removes `vendor/gopkg.in/gorp.v1` and vendors `vendor/gopkg/go-gorp/gorp.v2`, all tests pass.

Changes between `v1.7.1` and `v2.0.0`: c87af80f3c...4deece6103

Fixes #2490.
2017-03-08 12:20:22 -05:00
Daniel McCarney 1170f77680 Updates publicsuffix-go to 0.3.2. (#2596)
This commit updates the `publicsuffix-go` dependency to version 0.3.2,
the latest autopull.

Per CONTRIBUTING.md the tests are verified to pass:

```
 HEAD position was 5ebfcac... Fix outdated version number
 HEAD is now at c12e7e9... autopull: 2017-03-04T06:00:47Z (#62)
 ?      github.com/weppos/publicsuffix-go/cmd/load      [no test files]
 === RUN   TestPublicSuffix
 --- PASS: TestPublicSuffix (0.00s)
 === RUN   TestEffectiveTLDPlusOne
 --- PASS: TestEffectiveTLDPlusOne (0.00s)
 PASS
 ok     github.com/weppos/publicsuffix-go/net/publicsuffix      0.007s
 === RUN   TestValid
 --- PASS: TestValid (0.00s)
 === RUN   TestIncludePrivate
 --- PASS: TestIncludePrivate (0.00s)
 === RUN   TestIDNA
 --- PASS: TestIDNA (0.00s)
 === RUN   TestPsl
 --- PASS: TestPsl (0.01s)
 === RUN   TestNewListFromString
 --- PASS: TestNewListFromString (0.00s)
 === RUN   TestNewListFromString_IDNAInputIsUnicode
 --- PASS: TestNewListFromString_IDNAInputIsUnicode (0.00s)
 === RUN   TestNewListFromString_IDNAInputIsAscii
 --- PASS: TestNewListFromString_IDNAInputIsAscii (0.00s)
 === RUN   TestNewListFromFile
 --- PASS: TestNewListFromFile (0.00s)
 === RUN   TestListAddRule
 --- PASS: TestListAddRule (0.00s)
 === RUN   TestListFind
 --- PASS: TestListFind (0.00s)
 === RUN   TestNewRule_Normal
 --- PASS: TestNewRule_Normal (0.00s)
 === RUN   TestNewRule_Wildcard
 --- PASS: TestNewRule_Wildcard (0.00s)
 === RUN   TestNewRule_Exception
 --- PASS: TestNewRule_Exception (0.00s)
 === RUN   TestNewRule_FromASCII
 --- PASS: TestNewRule_FromASCII (0.00s)
 === RUN   TestNewRule_FromUnicode
 --- PASS: TestNewRule_FromUnicode (0.00s)
 === RUN   TestNewRuleUnicode_FromASCII
 --- PASS: TestNewRuleUnicode_FromASCII (0.00s)
 === RUN   TestNewRuleUnicode_FromUnicode
 --- PASS: TestNewRuleUnicode_FromUnicode (0.00s)
 === RUN   TestRuleMatch
 --- PASS: TestRuleMatch (0.00s)
 === RUN   TestRuleDecompose
 --- PASS: TestRuleDecompose (0.00s)
 === RUN   TestLabels
 --- PASS: TestLabels (0.00s)
 === RUN   TestCookieJarList
 --- PASS: TestCookieJarList (0.00s)
 PASS
 ok     github.com/weppos/publicsuffix-go/publicsuffix  0.027s
```
2017-03-06 12:47:00 -08:00
Daniel McCarney c3079c9b76 Merge pull request #2595 from letsencrypt/master
Merge master to staging
2017-03-06 12:01:29 -05:00
Roland Bracewell Shoemaker a65ea23353 Stop sending misleading error for malformed CSRs (#2594)
#565 was fixed > a month ago, just provide the actual parsing error.
2017-03-04 14:51:55 -08:00
Jacob Hoffman-Andrews 9ecd822611 Add WFE load generator to the tree (#2558)
Initial work on this was ripped out of the 'coyote' branch since it's better suited
to being worked on separately.

This adds cmd/load-generator, a tool for generating load on various publicly facing
boulder services. It currently implements a generator for the WFE and one for the
OCSP-Responder.

This also adds a latency-charter.py that consumes output from load-generator to generate plots of latency during load tests.

Fixes #1510 and #2399.
2017-03-03 09:21:37 -08:00
Roland Shoemaker 557578c89f Whoops, delete correct field 2017-03-02 16:52:25 -08:00
Roland Shoemaker 6e0e432dc8 Review fixes pt. 3 2017-03-02 15:13:33 -08:00
Jacob Hoffman-Andrews c576d3fea8 Merge branch 'master' into load-generators 2017-03-02 14:13:50 -08:00
Roland Shoemaker b19691e368 If no latency results file path is provided make latency stuff a noop 2017-03-01 16:35:07 -08:00
Roland Bracewell Shoemaker a7cd4fb2c7 Don't wrap errors we return from boulder/grpc/creds.ClientHandshake (#2590)
The gRPC client reconnect code needs to be able to check if a error is temporary so that it can decide if it should attempt to reconnect or just fail and kill the client[1]. By wrapping the error we were receiving in our TLS handshake code we were removing the existing `Temporary` interface on the error. This meant that if a client attempted to reconnect to a server that was in the process of being shutdown, the client would consider that server permanently dead and never retry.

Fix is simple: don't wrap errors that we pass back into the gRPC internals so that they can be properly inspected.

[1]: aefc96d792/clientconn.go (L783)
2017-03-01 11:27:03 -08:00
Roland Shoemaker 20f523204b Review fixes pt. 2 2017-02-27 15:33:12 -08:00
Daniel McCarney 5430c51e20 Move two migrations from `sa/_db-next/ to `sa/_db/`. (#2588)
Both the `20160818140745_AddRegStatus.sql` and
`20160914105917_RemoveChallengesAcctKeyAndTLS.sql` migrations have been
applied in production and can be moved out of `sa/_db-next/` to reflect
this fact.
2017-02-27 10:41:50 -08:00
Daniel McCarney 40fc6dac6c Merge pull request #2587 from letsencrypt/master
Merge master to staging.
2017-02-27 13:28:33 -05:00
Sophie Herold 5be390e9d7 Adds some divergences (#2578)
Adds some draft-05 divergences RE: account status field, challenge status code.
2017-02-27 09:36:17 -05:00
Daniel McCarney 9da55fd5a5 Merge pull request #2574 from calavera/update_to_go_1_8
Update to Go 1.8.0.
2017-02-24 12:24:01 -05:00
Roland Shoemaker 7189bbc79c Review fixes pt. 1 2017-02-22 13:56:08 -08:00
Daniel McCarney e23b4b6896 Adds script for tagging boulder-tools images. (#2577)
This commit adds a small script `tag_and_upload.sh` that:

1) Builds the boulder-tools image with the correct tag
2) Prompts you to log in to dockerhub
3) Pushes the boulder-tools image

This means I won't have to remember how to do this next time we need to
bump our Go version :-)
2017-02-21 12:00:44 -05:00
David Calavera 0dc2513d2d
Generate GRPC objects with Go 1.8.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-02-21 12:11:17 +01:00
David Calavera 0d1cc66cab
Update to Go 1.8.0.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2017-02-21 10:57:57 +01:00
Daniel McCarney f445cf3b32 Merge pull request #2575 from letsencrypt/master
Merge master to staging
2017-02-20 13:16:55 -05:00
Sophie Herold db3a6d6507 Draft-05 divergences and sync with release (#2573)
Updates acme-divergences.md for draft-05 changes.
2017-02-20 12:30:00 -05:00
Roland Shoemaker 415aa9598a Revert accidental inclusion of unrelated code 2017-02-16 13:20:07 -08:00
Daniel McCarney 81542c426d Removes explicit `boulder-tools` docker pull cmd. (#2569)
Remove explicit `boulder-tools` docker pull cmd.

Per @jsha's comment in #2567 it should be possible to remove the explicit docker pull letsencrypt/boulder-tools since the docker-compose pull that precedes it will take care of it.
2017-02-16 15:57:54 -05:00
Daniel McCarney fcf361c327 Remove CertStatusOptimizationsMigrated Feature Flag & Assoc. Cruft (#2561)
The NotAfter and IsExpired fields on the certificateStatus table
have been migrated in staging & production. Similarly the
CertStatusOptimizationsMigrated feature flag has been turned on after
a successful backfill operation. We have confirmed the optimization is
working as expected and can now clean out the duplicated v1 and v2
models, and the feature flag branching. The notafter-backfill command
is no longer useful and so this commit also cleans it out of the repo.

Note: Some unit tests were sidestepping the SA and inserting
certificateStatus rows explicitly. These tests had to be updated to
set the NotAfter field in order for the queries used by the
ocsp-updater and the expiration-mailer to perform the way the tests
originally expected.

Resolves #2530
2017-02-16 11:35:00 -08:00
Daniel McCarney 0fe8ae01f1 Adds explicit tag to Travis boulder-tools pull. (#2566)
Previously we had a 'latest' docker image tag for the `boulder-tools`
image that was *not* the most recent. This was confusing so we deleted
it this morning to close #2030.

Unfortunately Travis was defaulting to pulling the "latest" tag since
one wasn't specified (e.g. the way we do in `Dockerfile` and
`docker-compose.yml`). Resulting in build breakage:

```
docker pull letsencrypt/boulder-tools
Using default tag: latest
Pulling repository docker.io/letsencrypt/boulder-tools
Tag latest not found in repository docker.io/letsencrypt/boulder-tools
The command "docker pull letsencrypt/boulder-tools" failed and exited
with 1
```

This commit specifies the same tag as in `Dockerfile` and
`docker-compose.yml` for travis. We will need to update this tag when we
update the other places for a new boolder-tools image.
2017-02-15 17:19:36 -05:00
Jacob Hoffman-Andrews 1a92b5df28 Link to instructions to reset Docker. (#2563)
* Link to instructions to reset Docker.

* Use correct terms.
2017-02-15 10:41:56 -05:00
Roland Shoemaker 811740924a Revert docker-compose change 2017-02-14 21:00:16 -08:00
Roland Shoemaker fb4cdebfdc Revert pkcs11 config changes 2017-02-14 12:57:27 -08:00
Jacob Hoffman-Andrews 15bb5a8027 Properly close httptest Servers. (#2560)
Rolling forward #2110 now that we are on a modern Go.
2017-02-14 15:08:08 -05:00
Daniel McCarney a90b065d0d Merge pull request #2557 from letsencrypt/master
Merge master to staging
2017-02-13 13:52:48 -05:00
Roland Bracewell Shoemaker 0c04fe2f5e Move error wrapping/unwrapping into the interceptors (#2556)
Instead of using `unwrapError/wrapError` in each of the wrapper functions do it in the server/client interceptors instead. This means we now consistently do error unwrapping/wrapping.

Fixes #2509.
2017-02-13 12:56:23 -05:00
Jacob Hoffman-Andrews 154ee0af3b Add DNS challenge to integration test. (#2548)
Part of #2521.
2017-02-13 09:17:13 -08:00
Jacob Hoffman-Andrews 1b994083ba Use latest Certbot in boulder-tools. (#2554)
This allows us to iterate more easily against the current acme module.

Also, remove nodejs from boulder-tools, clean up a few packages that weren't
previously cleaned up, and install a specific version of protoc-gen-go to match
our vendored grpc.
2017-02-09 16:10:01 -08:00
Simone Carletti affa0e92cd Upgrade the PSL (and publicsuffix-go to v0.3.2) (#2553)
In the last weeks we made some large changes to the list of .RU and .SU domains in the PSL, due to some very old policy changes at the registry (2009) and more recent follow up.

Given the amount of pressure about these changes from certain users, most certainly because LE limits, I figured out you'll soon have people asking you to merge the changes. I've packaged a new release of publicsuffix-go, and updated the dependency in this PR.

$ git show master

commit c5490f26d8f43b84857ac54e23387b8ed9b100dd
Author: Simone Carletti <weppos@weppos.net>
Date:   Tue Feb 7 23:26:14 2017 +0100

    Release 0.3.2
➜  publicsuffix-go git:(master) go test ./...
?   	github.com/weppos/publicsuffix-go/cmd/load	[no test files]
ok  	github.com/weppos/publicsuffix-go/net/publicsuffix	0.023s
ok  	github.com/weppos/publicsuffix-go/publicsuffix	0.039s

Please note this release also includes the .ONION as per publicsuffix/list#374
2017-02-07 14:59:48 -08:00