HEX
Server: Apache/2.4.67 (Debian)
System: Linux hosting103 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User: muzikaecom (1013)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: //usr/local/share/hostingplatform/scripts/getDomainCertificate
#!/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/ssl/certs";
	var $dhparams_file        = "/usr/local/share/hostingplatform/dhparams.txt";

	function __construct($api) {
		$this->api = $api;
	}

	function getDomainCertificate($packagename, $domainname) {

		$dhparams = file_get_contents($this->dhparams_file);
		$certificate_file = $this->certificate_dir . "/$packagename-$domainname.pem";
		$certificate = file_get_contents($certificate_file);
		$certificate = str_replace($dhparams,"", $certificate);
                $certificate = trim($certificate);

		return $certificate;
	}
}