]>
Raphaƫl G. Git Repositories - acme/blob - www/acme-challenge.php
6f809b437261d64b259f45785788985f2dd1172f
3 $conf = '/etc/acme/config';
5 //Unable to show key.thumbprint couple
7 //Handle config parsing
8 !is_readable($conf) || ($config = file_get_contents($conf)) === false || ($config = json_decode($config)) === null ||
9 //Handle thumbprint file read
10 !is_readable($config->thumbprint
) || ($thumbprint = file_get_contents($config->thumbprint
)) === false ||
11 //Handle get key parsing
12 empty($_GET['key']) || !preg_match('/^[-_a-zA-Z0-9]+$/', $_GET['key'])
14 header((!empty($_SERVER['SERVER_PROTOCOL'])?$_SERVER['SERVER_PROTOCOL']:'HTTP/1.0').' 404 Not Found');
18 //Send plain text header
19 header('Content-Type: text/plain');
21 //Display key.thumbprint couple
22 echo $_GET['key'].$thumbprint;