/** * Solves a certain challenge. * * Return false if not possible. * * @param Challenge $challenge * @param array $payload * * @return bool */ public final function solve(Challenge $challenge, $payload = []) { $this->request = new Request(['solver' => __CLASS__, 'expires_at' => $challenge->getExpires(), 'hostname_id' => $challenge->getCertificate()->getIdentifier()]); $this->request->save(); // forward the request to the extended class $this->handle(); }
public function __construct(Hostname $hostname) { $this->hostname = $hostname; $this->contact = config('webserver.ssl.lets-encrypt-contact'); $this->directory = sprintf('%s/%s', config('webserver.ssl.lets-encrypt-storage-path'), array_get($this->contact, 'username')); // inject our custom namespace for Challenge solving. Challenge::setSolverLocations(['Hyn\\Webserver\\Solvers']); }
/** * @return \Hyn\LetsEncrypt\Acme\Client */ protected function acme() { return $this->challenge->getCertificate()->getAccount()->acme(); }
public function testDefaultSolversExist() { $this->assertTrue(in_array('Hyn\\LetsEncrypt\\Solvers', Challenge::getSolverLocations())); }