alphagov/cdn-acceptance-tests — pull request #70 by dcarley (2014-07-10 14:35:46+00:00)
Title: Only cache lookup for *edgeHost address

#### Enable TLS on backends by default

So that we can test CDN providers that support this rather than explicitly
disabling their TLS support for backends. It uses a self-signed certificate
that comes with `httptest.Server`.

It can be optionally disabled with a CLI flag. This has been done for the
mock tests in Vagrant and TravisCI because Varnish doesn't support TLS
backends.

I'm not using an existing CDNBackendServer in the new helper tests because
they need to be started with custom options. Whereas I think it's probably
correct for the other helper tests to use originServer, because they ensure
that it's functioning correctly for that run. The `0` port means that the OS
picks an available port at random.

I did consider using stunnel or extra proxying through Nginx in order to
make TLS mandatory. But I think it's probably more work than it's worth
right now.

#### Support custom TLS certificates

Allow a custom TLS certificate and private key to be passed in as CLI flags.
This will override the httptest.Server default self-signed certificate. It
will come in useful for CDN providers that perform strict checking of origin
certs.

This made me wonder whether we should write some tests to check whether
providers perform strict checking of cert chains and subject names. But
that's out of scope for now.

---

I've re-enabled SSL on our testing service and