Commit Graph

3415 Commits

Author SHA1 Message Date
Roland Bracewell Shoemaker e187c92715 Add gRPC client side metrics (#2151)
Fixes #1880.

Updates google.golang.org/grpc and github.com/jmhodges/clock, both test suites pass. A few of the gRPC interfaces changed so this also fixes those breakages.
2016-09-09 15:17:36 -04:00
Jacob Hoffman-Andrews d75a44baa0 Remove "network" and "server" from syslog configs. (#2159)
We removed these from the config object because we never use anything other than
the default empty string, which means "local socket."
2016-09-08 10:08:18 -04:00
Jacob Hoffman-Andrews 6f3d078414 Allow account deactivation (#2138)
Fixes #2011.
2016-09-07 19:36:54 -04:00
Roland Bracewell Shoemaker c8f1fb3e2f Remove direct usages of go-statsd-client in favor of using metrics.Scope (#2136)
Fixes #2118, fixes #2082.
2016-09-07 19:35:13 -04:00
Daniel McCarney a9d476ecf6 Mention the new "Improved Collaboration with Forks" GH Feature. (#2158) 2016-09-07 19:33:39 -04:00
Roland Shoemaker 7e25cba1e5 review fixes 2016-09-06 15:53:04 -07:00
Roland Shoemaker fcd534f378 Better error message 2016-09-06 15:01:49 -07:00
Daniel McCarney 97907b2ba8 Add `$GOPATH` troubleshooting to docker quickstart. (#2153)
We have seen a couple issues from folks that run into trouble using `docker-compose up` with invalid `$GOPATH`'s configured (e.g. see issues  #2150, #2141, #2112).

This PR adds a sentence to the README indicate that if you see a docker "oci runtime error" or a failure to create the container it may be caused by your `$GOPATH` and to check that first.
2016-09-06 13:31:21 -04:00
Blake Griffith 45bb14a31c Just pull the tip of certbot to save bandwidth. (#2146)
Changes the `test.sh` certbot git clone to use `--depth=1`. Prior to this commit the clone cost ~11 MiB. It now it costs ~784 KiB.
2016-09-06 10:25:34 -04:00
Roland Shoemaker 49c2436765 Remove acct deactivation section from docs/acme-divergences.md 2016-08-30 11:46:35 -07:00
Ben Irving ce0016bc08 HTTP-01 gives misleading "could not connect" error (#2142)
Fixes #2122
2016-08-29 11:45:32 -07:00
Blake Griffith 344a312905 Remove audit comments -- closes #2129 (#2139)
Closes #2129

* Remove audit comments.
* Nuke doc/requirements/*
2016-08-25 18:23:42 -07:00
Roland Shoemaker 7acb620e77 Review fixes pt. 2 2016-08-25 16:35:40 -07:00
Roland Shoemaker dbf9afa7d6 Review fixes pt. 1 2016-08-25 16:28:58 -07:00
Roland Shoemaker 3e78c1e087 Travis prod 2016-08-24 14:38:30 -07:00
Roland Shoemaker ced8acd074 Add RPC stuff 2016-08-24 13:11:01 -07:00
Roland Shoemaker c7e5ed1262 RA/WFE tests 2016-08-24 12:36:41 -07:00
Roland Shoemaker b95ddc6643 Add SA tests 2016-08-24 11:59:45 -07:00
Roland Shoemaker aa7f85d3f5 Merge branch 'master' into reg-deact 2016-08-24 11:51:15 -07:00
Roland Bracewell Shoemaker 51ee04e6a9 Allow authorization deactivation (#2116)
Implements `valid` and `pending` authz deactivation.
2016-08-23 16:25:06 -04:00
Roland Bracewell Shoemaker 91bfd05127 Revert #2088 (#2137)
* Remove oldx509 usage

* Un-vendor old crypto/x509, crypto/x509/pkix, and encoding/asn1
2016-08-23 14:01:37 -04:00
Roland Bracewell Shoemaker 60bf1db8e1 Profile the nonce service (#2135)
Adds `NonceService` metrics output.
2016-08-23 13:58:16 -04:00
Roland Shoemaker 003158c9e3 Initial impl 2016-08-18 14:12:09 -07:00
Jacob Hoffman-Andrews 0543691d9e Add stats to Publisher (#2083)
Fixes #1576.

Adds a new package mock_metrics, with code generated by gomock, in order to test the change.
Modifies publisher.New to take a metrics.Scope and an SA, and unexport SA.
Moves core of submission loop into a separate function, singleLogSubmit, which can return an error rather than using the continue keyword. This reduces repetition of AuditErr lines, and makes it easier to put error statting in one place.
2016-08-17 16:25:33 -07:00
Roland Bracewell Shoemaker 8d8263ac22 Switch CSR logging from base64 to hex (#2131) 2016-08-17 10:26:13 -04:00
Daniel McCarney a584f8de46 Allow `mailer` to reconnect to server. (#2101)
The `MailerImpl` gains a few new fields (`retryBase`, &  `retryMax`). These are used with `core.RetryBackoff` in `reconnect()` to implement exponential backoff in a reconnect attempt loop. Both `expiration-mailer` and `notify-mailer` are modified to add CLI args for these 2 flags and to wire them into the `MailerImpl` via its `New()` constructor.

In `MailerImpl`'s `SendMail()` function it now detects when `sendOne` returns an `io.EOF` error indicating that the server closed the connection unexpectedly. When this case occurs `reconnect()` is invoked. If the reconnect succeeds then we invoke `sendOne` again to try and complete the message sending operation that was interrupted by the disconnect.

For integration testing purposes I modified the `mail-test-srv` to support a `-closeChance` parameter between 0 and 100. This controls what % of `MAIL` commands will result in the server immediately closing the client connection before further processing. This allows us to simulate a flaky mailserver. `test/startservers.py` is modified to start the `mail-test-srv` with a 35% close chance to thoroughly test the reconnection logic during the existing `expiration-mailer` integration tests. I took this as a chance to do some slight clean-up of the `mail-test-srv` code (mostly removing global state).

For unit testing purposes I modified the mailer `TestConnect` test to abstract out a server that can operate similar to `mail-test-serv` (e.g. can close connections artificially).

This is testing a server that **closes** a connection, and not a server that **goes away/goes down**. E.g. the `core.RetryBackoff` sleeps themselves are not being tested. The client is disconnected and attempts a reconnection which always succeeds on the first try. To test a "gone away" server would require a more substantial rewrite of the unit tests and the `mail-test-srv`/integration tests. I think this matches the experience we have with MailChimp/Mandril closing long lived connections.
2016-08-15 14:14:49 -07:00
Roland Bracewell Shoemaker c5d6166f08 Add registration update work around for new subscriber agreement URL (#2103)
Fixes #2102
2016-08-15 13:31:48 -07:00
Jacob Hoffman-Andrews fadc1f5baf Log cert in TLS-SNI challenge. (#2127)
Fixes #2126
2016-08-15 11:40:28 -07:00
Daniel McCarney 95db733f57 Update publicsuffix-go to +2605b7 (#2123)
This commit updates the publicsuffix-go dependency to upstream HEAD (commit
088a5b7b1f746fca57b9440f8e94f9b3302605b7 (there are no tags or releases
for this project)).

Per CONTRIBUTING.md I ran the project unit tests:

```
daniel@xxxxxxxxx:~/go/src/github.com/weppos/publicsuffix-go$ git show -s
commit 088a5b7b1f746fca57b9440f8e94f9b3302605b7
Author: Simone Carletti <weppos@weppos.net>
Date:   Wed Aug 10 10:52:20 2016 +0200

    autopull: 2016-08-10T06:00:16Z (#20)

daniel@xxxxxxxxx:~/go/src/github.com/weppos/publicsuffix-go$ go test ./...
    ?     github.com/weppos/publicsuffix-go/cmd/gen [no test files]
    ?     github.com/weppos/publicsuffix-go/cmd/load  [no test files]
    ok    github.com/weppos/publicsuffix-go/net/publicsuffix  0.008s
    ok    github.com/weppos/publicsuffix-go/publicsuffix  0.029s
```
2016-08-15 10:10:20 -07:00
Jacob Hoffman-Andrews 839d503a2d Add link to expiration email doc in emails. (#2121) 2016-08-12 15:31:57 -04:00
Ben Irving 8ed5b1e6a1 Replace *AcmeURL with string (#2117)
Removes core.AcmeURL from boulder and uses string instead.

Fixes #1996
2016-08-11 13:27:19 -07:00
Daniel McCarney a0a12cb297 Fix nil panic with `-dryRun=true` (#2115)
While finalizing the testing for #2101 I noticed that the `notify-mailer` would panic when `-dryRun=true` (e.g. the default value):

```
E150646 notify-mailer [AUDIT] Panic caused by err: runtime error: invalid memory address or nil pointer dereference
E150646 notify-mailer [AUDIT] Stack Trace (Current frame) goroutine 1 [running]:
github.com/letsencrypt/boulder/log.(*impl).AuditPanic(0xc820167610)
	/home/daniel/go/src/github.com/letsencrypt/boulder/log/log.go:190 +0x190
panic(0x9804a0, 0xc82000e120)
	/usr/local/go/src/runtime/panic.go:443 +0x4e9
github.com/letsencrypt/boulder/metrics.(*StatsdScope).Inc(0x0, 0xa9ad30, 0x11, 0x1, 0x0, 0x0)
	/home/daniel/go/src/github.com/letsencrypt/boulder/metrics/scope.go:68 +0xd5
github.com/letsencrypt/boulder/mail.(*MailerImpl).SendMail(0xc8201dc360, 0xc8203d5150, 0x1, 0x1, 0x7ffeda89737c, 0x1a, 0xc8201f0000, 0x517, 0x0, 0x0)
	/home/daniel/go/src/github.com/letsencrypt/boulder/mail/mailer.go:290 +0x108
main.(*mailer).run(0xc820175ea8, 0x0, 0x0)
	/home/daniel/go/src/github.com/letsencrypt/boulder/cmd/notify-mailer/main.go:108 +0x362
main.main()
	/home/daniel/go/src/github.com/letsencrypt/boulder/cmd/notify-mailer/main.go:365 +0x142e
```

This was caused by the `NewDryRun` constructor not initializing the `stats` member of the `MailerImpl` and is fixed in this commit.
2016-08-11 11:29:40 -07:00
Jacob Hoffman-Andrews 243832822a Remove transaction in updateCertStatus. (#2096)
Formerly in expiration-mailer, when we wanted to set `lastNagSent` to `Now()`, we started a transaction, read the object, updated one field, wrote it back, and closed the transaction.

This commit replaces the transaction and instead does a much simpler and more efficient `UPDATE certificateStatus SET lastNagSent = ? where serial = ?;`.
2016-08-09 09:44:02 -04:00
Ben Irving 8b622c805a Move MergeUpdate out of core (#2114)
Fixes #2022
2016-08-08 17:12:52 -07:00
Roland Bracewell Shoemaker fc39781274 Allow user specified revocation reason (#2089)
Fixes #140.

This patch allows users to specify the following revocation reasons based on my interpretation of the meaning of the codes but could use confirmation from others.

* unspecified (0)
* keyCompromise (1)
* affiliationChanged (3)
* superseded (4)
* cessationOfOperation (5)
2016-08-08 14:26:52 -07:00
Jacob Hoffman-Andrews 21ecdc2008 Tidy up test.sh. (#2108)
Remove the code that echoes exit status on integration failure. It was buggy and
would always print 0, which was confusing. Instead, use `run`.

Rename run_and_comment to run_and_expect_silence, since it doesn't comment
anymore.
2016-08-08 11:54:54 -07:00
Jacob Hoffman-Andrews 5efccc5eb3 Always log malformed CSRs, even if check is off. (#2109)
This will help us evaluate their prevalence more easily.
2016-08-08 09:46:58 -04:00
Roland Bracewell Shoemaker 4092d0d5d9 Close VA HTTP test servers (#2111)
Fixes #661 / follow-up to #2110.
2016-08-06 08:57:42 -07:00
Ben Irving daf3a988f9 Properly close test servers (#2110)
Now that we are on Go 1.6 we can properly close `httptest.Server`
Fixes #1989
2016-08-05 15:04:42 -07:00
Jacob Hoffman-Andrews c97f28055c Update tests to use multi-issuer format and ca2 (#1638)
Builds on #1635.
2016-08-05 13:42:03 -07:00
Roland Bracewell Shoemaker e3266a1684 Switch to Golang 1.6.3 (#2105)
* Switch to golang 1.6

* Update docker image references

* Update godep major version

* Remove GO15VENDOREXPERIMENT references

* Fix errcheck ignore path
2016-08-05 16:35:43 -04:00
Maarten ce3f1b829c edit test/setup.sh so goose gets installed before create_db.sh is run (#2104)
The create_db.sh script needs goose to create and fill the database. This is not
available yet, because it is simultaneously being installed in line 10. By moving the create_db.sh call after the `wait`, we make sure goose is available.
2016-08-04 11:09:26 -07:00
Daniel McCarney ac80a8e421 Fix outdated Lets Encrypt client reference. (#2099)
As a follow-up to #2098 this PR changes the sentence describing "an alias for letsencrypt" to reference an "alias to certbot" instead. This fixes what was an outdated reference to the client formerly known as Let's Encrypt, now Certbot.
2016-08-01 16:47:55 -04:00
Okke Timm 850096ac62 update slow start client path to use certbot (#2098)
The slow start guide's "working with a client" section of the README still referenced a `letsencrypt` path instead of the correct `certbot` path when describing sourcing the integration test alias script. This PR updates the path to use certbot.
2016-08-01 10:24:48 -04:00
Jacob Hoffman-Andrews ffd8e92896 Disable validations to 2002::/16 (6to4 anycast) (#2095)
We disable validations to IPs under the 6to4 anycase prefix because
there's too much risk of a malicious actor advertising the prefix and
answering validations for a 6to4 host they do not control.

https://community.letsencrypt.org/t/problems-validating-ipv6-against-host-running-6to4/18312/9
2016-08-01 10:15:32 -04:00
Ben Irving b587d4e663 Simplify KeyPolicy code (#2092)
This PR, removes the allowedSigningAlgos configuration struct and hard codes a key policy.

Fixes #1844
2016-07-30 16:15:19 -07:00
Jacob Hoffman-Andrews 9a57ba9b5f Remove period at end of sentence in expiry email. (#2094)
Some email clients may make this part of the link, which breaks the link.
2016-07-29 16:14:53 -07:00
Ben Irving 987c78bb29 Update Readme (#2091)
* Update Readme
* Use better english (thanks cpu)
* Overload -> Override
* - \n
* Update ifconfig command
2016-07-28 13:39:06 -07:00
Ben Irving 573d1f1669 Stop logging full PEM objects (#2090)
Previously, the CA would log the full PEM encoded certificate signing request and the signed certificate. This PR, removes that, and logs a base64 encoded version of the request and the certificate.

Due to the fact that cfssl returns the certificate in PEM format regardless, we decode the certificate into DER and log the base64 version. If there is any failure in the decoding from PEM to DER, the CA will log the PEM encoded version of the certificate (this is the only case).

Furthermore, the Signing Success message was moved after the certificate is checked for 0 length and decoded into DER, which seems to make logical sense to me.

Fixes #1968
2016-07-28 13:38:26 -07:00
Jacob Hoffman-Andrews 474b76ad95 Import forked x509 for parsing of CSRs with empty integers (#2088)
Part of #2080.

This change vendors `crypto/x509`, `crypto/x509/pkix`, and `encoding/asn1` from  1d5f6a765d. That commit is a direct child of the Go 1.5.4 release tag, so it contains the same code as the current Go version we are using. In that commit I rewrote imports in those packages so they depend on each other internally rather than calling out to the standard library, which would cause type disagreements.

I changed the imports in each place where we're parsing CSRs, and imported under a different name `oldx509`, both to avoid collisions and make it clear what's going on. Places that only use `x509` to parse certificates are not changed, and will use the current standard library.

This will unblock us from moving to Go 1.6, and subsequently Go 1.7.
2016-07-28 10:38:33 -04:00