File: //usr/local/share/hostingplatform/scripts/getServerCertificate
#!/usr/bin/env php
<?php
require_once("/usr/local/share/hostingplatform/esrpc.php");
$server = new ESRPCConnection();
$worker = new Worker($server->get());
$server->setTarget($worker);
$server->connect();
$server->serve();
class Worker {
var $api;
var $certificate_dir = "/etc/apache2-hostingplatform-api";
function __construct($api) {
$this->api = $api;
}
function getServerCertificate() {
$certificate_file = $this->certificate_dir . "/hostingplatform-api.crt";
return file_get_contents($certificate_file);
}
}