Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #93 from AlexNodex/patch-2
Browse files Browse the repository at this point in the history
Update LEClient.php
  • Loading branch information
yourivw authored Jun 20, 2021
2 parents 07c3efe + b6935c9 commit 6ceab6a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/LEClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ class LEClient

private $connector;
private $account;


private $sourceIp = false;

private $log;

const LOG_OFF = 0; // Logs no messages or faults, except Runtime Exceptions.
Expand All @@ -65,10 +67,10 @@ class LEClient
* @param string $accountKeys The directory in which the account keys are stored. Is a subdir inside $certificateKeys. Defaults to '__account/'.(optional)
* @param array $accountKeys Optional array containing location of account private and public keys. Required paths are private_key, public_key.
*/
public function __construct($email, $acmeURL = LEClient::LE_PRODUCTION, $log = LEClient::LOG_OFF, $certificateKeys = 'keys/', $accountKeys = '__account/')
public function __construct($email, $acmeURL = LEClient::LE_PRODUCTION, $log = LEClient::LOG_OFF, $certificateKeys = 'keys/', $accountKeys = '__account/', $sourceIp = false)
{
$this->log = $log;

$this->sourceIp = false;
if (is_bool($acmeURL))
{
if ($acmeURL === true) $this->baseURL = LEClient::LE_STAGING;
Expand Down Expand Up @@ -152,7 +154,7 @@ public function __construct($email, $acmeURL = LEClient::LE_PRODUCTION, $log = L
throw LEClientException::InvalidArgumentException('accountKeys must be string or array.');
}

$this->connector = new LEConnector($this->log, $this->baseURL, $this->accountKeys);
$this->connector = new LEConnector($this->log, $this->baseURL, $this->accountKeys, $this->sourceIp);
$this->account = new LEAccount($this->connector, $this->log, $email, $this->accountKeys);

if($this->log instanceof \Psr\Log\LoggerInterface)
Expand Down

0 comments on commit 6ceab6a

Please sign in to comment.