Exemplo n.º 1
0
 /**
  * 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();
 }
Exemplo n.º 2
0
 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']);
 }
Exemplo n.º 3
0
 /**
  * @return \Hyn\LetsEncrypt\Acme\Client
  */
 protected function acme()
 {
     return $this->challenge->getCertificate()->getAccount()->acme();
 }
Exemplo n.º 4
0
 public function testDefaultSolversExist()
 {
     $this->assertTrue(in_array('Hyn\\LetsEncrypt\\Solvers', Challenge::getSolverLocations()));
 }