whmcs-ocsp-stapling
OCSP stapling setup for WHMCS
SKILL.mdskills/whmcs-ocsp-stapling/SKILL.md
GitHubWHMCS OCSP Stapling Skill
Overview
This skill provides patterns for configuring OCSP stapling in WHMCS.
Implementation Patterns
OCSP Stapling Manager
<?php
/**
* WHMCS OCSP Stapling
* Configures OCSP stapling
*/
namespace WHMCS\Module\Server\SSL;
class OCSPStaplingManager {
/**
* Configure nginx for OCSP stapling
*/
public function configureNginx(string $domain): string {
return <<<CONFIG
server {
listen 443 ssl;
server_name {$domain};
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
ssl_trusted_certificate /etc/ssl/certs/ca-bundle.crt;
}
CONFIG;
}
/**
* Check OCSP status
*/
public function checkOCSPStatus(string $domain): array {
$output = shell_exec("echo | openssl s_client -connect {$domain}:443 -status 2>&1");
return [
'domain' => $domain,
'ocsp_responder' => strpos($output, 'OCSP Response') !== false
];
}
}
Best Practices
- Enable Stapling: Enable OCSP stapling on servers
- Trust Chain: Ensure complete trust chain
- Cache OCSP: Cache OCSP responses
- Fallback: Handle OCSP failures gracefully
- Monitoring: Monitor OCSP response times
Related Skills
- whmcs-crl-distribution
- whmcs-tls-configuration
- whmcs-ssl-renewal
- whmcs-ssl-monitor