This repository has been archived by the owner on Nov 2, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added SSL analysis and certificate packs
- Loading branch information
1 parent
fdd5c45
commit 8616dde
Showing
3 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Cloudflare\Zone\SSL; | ||
|
||
use Cloudflare\Api; | ||
use Cloudflare\Zone; | ||
use Cloudflare\Zone\SSL; | ||
|
||
/** | ||
* CloudFlare API wrapper | ||
* | ||
* Analyze Certificate | ||
* | ||
* @author James Bell <james@james-bell.co.uk> | ||
* @version 1 | ||
*/ | ||
|
||
class Analyze extends Api | ||
{ | ||
/** | ||
* Default permissions level | ||
* @var array | ||
*/ | ||
protected $permission_level = array('read' => '#ssl:read', 'edit' => '#ssl:edit'); | ||
|
||
/** | ||
* Analyze Certificate (permission needed: #ssl:read) | ||
* Returns the set of hostnames, the signature algorithm, and the expiration date of the certificate. | ||
* @param string $identifier | ||
* @param string $certificate The zone's SSL certificate or certificate and the intermediate(s) | ||
* @param string|null $bundle_method A ubiquitous bundle is a bundle that has a higher probability of | ||
* being verified everywhere, even by clients using outdated or unusual | ||
* trust stores. An optimal bundle is a bundle with the shortest chain and | ||
* newest intermediates. A forced method attempt to use the certificate/chain | ||
* as defined by the input | ||
*/ | ||
public function analyze($identifier, $certificate, $bundle_method = null) | ||
{ | ||
$data = array( | ||
'certificate' => $certificate, | ||
'bundle_method' => $bundle_method | ||
); | ||
return $this->post('/zones/' . $identifier . '/ssl/analyze', $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Cloudflare\Zone\SSL; | ||
|
||
use Cloudflare\Api; | ||
use Cloudflare\Zone; | ||
use Cloudflare\Zone\SSL; | ||
|
||
/** | ||
* CloudFlare API wrapper | ||
* | ||
* Certificate Packs | ||
* | ||
* @author James Bell <james@james-bell.co.uk> | ||
* @version 1 | ||
*/ | ||
|
||
class CertificatePacks extends Api | ||
{ | ||
/** | ||
* Default permissions level | ||
* @var array | ||
*/ | ||
protected $permission_level = array('read' => '#ssl:read', 'edit' => '#ssl:edit'); | ||
|
||
/** | ||
* List all certificate packs (permission needed: #ssl:read) | ||
* For a given zone, list all certificate packs | ||
* @param string $identifier | ||
*/ | ||
public function certificate_packs($identifier) | ||
{ | ||
return $this->get('/zones/' . $identifier . '/ssl/certificate_packs'); | ||
} | ||
} |