diff options
author | Remy <relst@relst.nl> | 2015-09-22 15:43:11 +0200 |
---|---|---|
committer | Remy <relst@relst.nl> | 2015-09-22 15:43:11 +0200 |
commit | 9f335dabf0c022122d2ddf0c24206b40d5154771 (patch) | |
tree | ff1cbb2db7e7f06422beefd2ff12a1e98ba6c377 /functions/json.php | |
parent | 0c4df45421a41e15251b010231c1b22415103ce4 (diff) | |
download | ssl-decoder-9f335dabf0c022122d2ddf0c24206b40d5154771.zip ssl-decoder-9f335dabf0c022122d2ddf0c24206b40d5154771.tar.gz ssl-decoder-9f335dabf0c022122d2ddf0c24206b40d5154771.tar.bz2 |
Add certificate transparency log submission
Diffstat (limited to 'functions/json.php')
-rw-r--r-- | functions/json.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/functions/json.php b/functions/json.php index 0abed70..997e892 100644 --- a/functions/json.php +++ b/functions/json.php @@ -56,6 +56,27 @@ function check_json($host,$ip,$port) { } else { $data["chain"][$chain_key] = cert_parse_json($curr, $next, null, false); } + // certificate transparency + $ct_urls = ["https://ct.ws.symantec.com", + "https://ct.googleapis.com/pilot", + "https://ct.googleapis.com/aviator", + "https://ct.googleapis.com/rocketeer", + "https://ct1.digicert-ct.com/log", + "https://ct.izenpe.com", + "https://ctlog.api.venafi.com", + "https://log.certly.io"]; + $data["certificate_transparency"] = []; + foreach ($ct_urls as $ct_url) { + $submitToCT = submitCertToCT($data["chain"], $ct_url); + $ct_result = json_decode($submitToCT, TRUE); + if ($ct_result === null + && json_last_error() !== JSON_ERROR_NONE) { + $result_ct = array('result' => $submitToCT); + $data["certificate_transparency"][$ct_url] = $result_ct; + } else { + $data["certificate_transparency"][$ct_url] = $ct_result; + } + } } } else { $data["error"] = ["Chain too long."]; |