(PUP-2505) Implement DELETE verb for HTTP routing

Duplicates:
   PUP-2483 Deleting a certificate does not work with the API
   PUP-2516 Delete a clients certificate with HTTP API no longer working

HTTP API requests using the DELETE method are failing with "Server Error:
undefined method `each' for nil:NilClass"...

e.g.
 curl -k -X DELETE https://${PMASTER}:8140/production/certificate_status/$AGENT

Traced problem back to missing specification for :DELETE in @method_handlers
(PUP-2505) Add method to specify delete handlers

Amending pull request per review comment.  Adding handler for delete
method.
(PUP-2505) Add test for delete handling
(PUP-2505) Reject requests with unknown HTTP verbs

When we forgot to handle DELETE the error showed up as a 500 because the
code tried to call a method on nil. The correct response is a 405, since
the server does not handle that method. Now that GET, POST, PUT, HEAD,
and DELETE are all covered, it should be safe to respond with 405 in all
other cases.
(PUP-2582) Update apache vhost SSL settings

Previously the apache vhost defined an SSLCipherSuite which included
several weak ciphers. This commit disables the following algorithms:
aNULL, eNULL, DES, 3DES, IDEA, SEED, DSS, PSK, RC4, MD5

Second, previously LOW, SSLv2, and EXP were removed, but not
killed from the list, which meant that they could be added again in
subsequent declarations.

Third, ALL:!ADH meant that AECDH was enabled. This commit uses !aNULL
to disable all anonymous authentication algorithms. It also explicitly
specifies !eNULL (anonymous encryption algorithms).

Fourth, we were only enabling SSLv3 and TLSv1, but not TLSv1.1 or
TLSv1.2. TLSv1.2 protects against attacks known to work against SSLv3
and TLSv1.0.

Finally, SSLHonorCipherOrder is set to on, because certain clients do
not send ciphers in the correct preferred order, and this setting will
help mitigate that problem.

Thanks to Aaron Zauner <azet@azet.org> for bringing this to our attention.
Merge branch 'pr/2657' into stable

* pr/2657:
  (PUP-2582) Update apache vhost SSL settings
Merge remote-tracking branch 'zaphod42/issue/stable/pup-2505-delete-not-respected' into stable

* zaphod42/issue/stable/pup-2505-delete-not-respected:
  (PUP-2505) Reject requests with unknown HTTP verbs
  (PUP-2505) Add test for delete handling
  (PUP-2505) Add method to specify delete handlers
  (PUP-2505) Implement DELETE verb for HTTP routing
Merge remote-tracking branch 'upstream/stable'

* upstream/stable:
  (PUP-2582) Update apache vhost SSL settings
  (PUP-2505) Reject requests with unknown HTTP verbs
  (PUP-2505) Add test for delete handling
  (PUP-2505) Add method to specify delete handlers
  (PUP-2505) Implement DELETE verb for HTTP routing
(PUP-2519) Create the default directory environment

Directory environments are not guaranteed to exist; Puppet provides a
fallback staticly loaded environment for the default production
environment if it does not exist, but we would prefer to set up a real
directory environment if possible to provide a better experience for new
installations.

This commit adjusts the Puppet::Settings catalog to create the default directory
environment in the first `environmentpath` directory if that directory
exists.

Now that the production directory environment is created implicitly by
the Puppet settings catalog when we have an environmentpath, the
can_enumerate_environments test needs to expect that the production
environment will be there along with the two we have explicitly created.
(PUP-2519) Ignore module directories if env does not exist

Puppet::Util::Autoload will attempt to look up module directories in the
given or configured environment, but there is no guarantee that the
environment exists when using directory environments, and Autoload's
module_directories method fails if a nil environment is being handled.

Given that puppet applications now directly set the current environment
during their initialization and we have adjusted other points in puppet
that used to lookup the configured environment to instead use the
current environment, module_directories now skips and returns an empty
array if no environment is found during bootstrapping.
(PUP-2519) Create fallback environment only for default production

The goal here was to only produce a fallback environment for the default
'production' environment which would only be found if the production
directory environment did not exist.  All other cases would raise an
error during application start up if the environment did not exist.
Except for applications in agent mode which currently need the concept of
the environment they will be requesting, but should not have to create
or verify the existence of a locally matching environment in their
environmentpath.

A few other changes are made to further narrow the scope of code making
open requests for the configured environment:

* indirection request - looks up current environment now, relying on
  this having been set by whatever application is making the request.
* puppet apply - instead of creating a new loader with a single static
  environment, it overrides current_environment instead.
* puppet util commandline - does not attempt to look for additional
  plugins if there is no environment to search in.  It relies on
  application to raise an error instead, if necessary.
(PUP-2159) Serialize node.environment as environment_name

Puppet::Node used to implicitly lookup and set an environment instance
when deserializing it's environment attribute String.  On an agent run,
with directory environments set, this was likely to produce a node with
a nil environment.

Henrik Lindberg and I changed node to deserialize the environment to an
environment_name attribute, separating the process of deserialization
from lookup and assignment of an actual environment.  The configurer can
then check to see whether the node already has an environment, and if
not, if it has an environment_name, it can create a remote environment
instance for the node so the agent can proceed without needing a
directory environment to exist.
(PUP-2519) Set environment for request or fail explicitly

The Indirector::Request#environment= setter would fall back to looking
up an environment from the environment loaders if given something that
was not an actual environment instance. If directory environments have
been set, this can return nil, and while a Request#environment will fall
back to the current_environment, there was no warning that you have
attempted to set an environment and been ignored.

To make this clearer, the setter will now first attempt to use the
current_environment if it matches the given environment name, and will
explicitly raise an EnvironmentNotFound error if no matching environment
is found. The use of the current_environment with a matching name is
preferred over looking up a configured environment because there may be
no directory environment to load.
(PUP-2519) Test agent with directory environments enabled
(maint) Add environment review tests

PUP-2214 and PUP-2519 have resolved the remaining issues related to
non-existent directory environments and directory environment
configuration which were causing the directory environment acceptance
test to fail.  I'm including these three tests now as a baseline for
static, dynamic and directory environment behavior.
Merge pull request #2646 from jpartlow/issue/master/pup-2519-settings-create-environment-dir

Issue/master/pup 2519 settings create environment dir
Merge branch 'master' of https://github.com/puppetlabs/puppet