FGasper / p5-Net-ACME2

CPAN’s Net::ACME2
Other
3 stars 7 forks source link

Simplify switching between LE production & staging servers. #6

Closed FGasper closed 6 years ago

FGasper commented 6 years ago

By request from @hackman (https://github.com/FGasper/p5-Net-ACME2/pull/5)

  1. Separate modules?
  2. custom host parameter?
  3. global flag in LetsEncrypt.pm?
  4. ??
hackman commented 6 years ago

My proposal is to have a default as a constant int LetsEncrypt.pm, but if the user supplies host in the options, the host to be overriden with the supplied value from the user.

Option 2 for me is a simple boolean selector between staging and production.

The idea behind this is, that it would be easy to execute tests without actually changing the system installation.

FGasper commented 6 years ago

My thinking now is to make it:

    my $acme = Net::ACME2::LetsEncrypt->new(
        key => $key_pem,
        environment => 'staging',   #default: “production”
    );

That will avoid putting the LE-specific determination of staging/production into the main module.

hackman commented 6 years ago

I'm OK with that. Can I offer a pull request with that? :)

FGasper commented 6 years ago

@hackman I’ve pushed up a commit (f5fcf9bf4eaec064269fafc9c2cce867997c4afc) with this change. If you have a chance, have a look.

hackman commented 6 years ago

@FGasper it works on a few of my machines and I like it. I'm sure that the QAs will also like it :)