cloudflare icon indicating copy to clipboard operation
cloudflare copied to clipboard

Detection of Free SSL status is missing

Open fmp777 opened this issue 8 years ago • 4 comments

Would be good to implement ability to check the status of cloudflare's free ssl. The reason being that when you create a zone, the SSL may take some indeterminate amount of time to be ready. So before you enabled forced SSL, you have to check to see if its ready.

You can also tell cloudflare to retry the SSL which is can sometimes be useful.

Consider this patch to Zone/SSL.php

	/**
	 * Get SSL Verification Info for a Zone (permission needed: #ssl:read)
	 * https://api.cloudflare.com/#ssl-verification-properties
	 *
	 * @param string $zone_identifier API item identifier tag
	 */
	public function free_ssl_status($zone_identifier)
	{
		return $this->get('zones/'.$zone_identifier.'/ssl/verification');
	}

	/**
	 * Immediately retry SSL verification (permission needed: #ssl:edit)
	 * https://api.cloudflare.com/#ssl-verification-properties
	 *
	 * @param string $zone_identifier API item identifier tag
	 */
	public function free_ssl_retry($zone_identifier)
	{
		$data = [
			'retry' => true
		];

		return $this->get('zones/'.$zone_identifier.'/ssl/verification', $data);
	}

fmp777 avatar Aug 31 '17 18:08 fmp777

Hi

Please can you submit a pull request for this.

Thanks, James

jamesryanbell avatar Aug 31 '17 18:08 jamesryanbell

sure, all set

fmp777 avatar Aug 31 '17 18:08 fmp777

Hmm, it appears that I created a pull request (#84) for the same stuff, but my version uses one method with an optional parameter, like all other methods.

shadowlmd avatar Dec 04 '17 20:12 shadowlmd

@jamesryanbell, can you please merge #84?

shadowlmd avatar Dec 21 '17 18:12 shadowlmd