Merge pull request #376 from w6g23/LE-UserAgent

Set a User Agent in the HTTP request fetching the LE challenge URI
This commit is contained in:
Michael Kaufmann
2016-08-28 14:04:01 +02:00
committed by GitHub

View File

@@ -176,7 +176,9 @@ class lescript
$this->log("Token for $domain saved at $tokenPath and should be available at $uri");
// simple self check
if ($payload !== trim(@file_get_contents($uri))) {
$selfcheckContextOptions = array('http' => array('header' => "User Agent: Froxlor"));
$selfcheckContext = stream_context_create($selfcheckContextOptions);
if ($payload !== trim(@file_get_contents($uri, false, $selfcheckContext))) {
$errmsg = json_encode(error_get_last());
if ($errmsg != "null") {
$errmsg = "; PHP error: " . $errmsg;