problems[domain]="The domain's DNS is pointed elsewhere, so a TLS certificate is not necessary here and cannot be provisioned automatically anyway."
problems[domain]="The domain's DNS is pointed elsewhere, so there is no point to installing a TLS certificate here and we could not automatically provision one anyway because provisioning requires access to the website (which isn't here)."
# Filter out domains that we can't provision a certificate for.
<p>You need a TLS certificate for this box’s hostname ({{hostname}}) and every other domain name and subdomain that this box is hosting a website for (see the list below).</p>
<divid="ssl_provision">
<h3>Provision a Certificate</h3>
<p>We can provision an SSL certificate for you from <ahref="https://letsencrypt.org/"target="_blank">Let’s Encrypt</a>, a free SSL certificate provider.</p>
<p>A TLS certificate can be automatically provisioned from <ahref="https://letsencrypt.org/"target="_blank">Let’s Encrypt</a>, a free TLS certificate provider, for:<br>
<p>Use the <em>Install Certificate</em> button below for these domains.</p>
</div>
</div>
<h3>Certificate Status</h3>
<pstyle="margin-top: 1.5em">Certificates expire after a period of time. All certificates will be automatically renewed through <ahref="https://letsencrypt.org/"target="_blank">Let’s Encrypt</a> 14 days prior to expiration.</p>
<p>(A multi-domain or wildcard certificate will be automatically applied to any domains it is valid for besides the one you choose above.)</p>
<p>What country are you in? This is required by some TLS certificate providers. You may leave this blank if you know your TLS certificate provider doesn't require it.</p>
// Nothing was done. There might also be problem domains, but we've already displayed those.
if(status.requests.length==0){
show_modal_error("TLS Certificate Provisioning","There were no domain names to provision certificates for.");
// don't return - haven't re-enabled the provision button
}
// Each provisioning API call returns zero or more "requests" which represent
// a request to Let's Encrypt for a single certificate. Normally there is just
// one request (for a single multi-domain certificate).
for(vari=0;i<status.requests.length;i++){
varr=status.requests[i];
// create an HTML block to display the results of this request
varn=$("<div><h4/><p/></div>");
$('#ssl_provision_result').append(n);
// show a header only to disambiguate request blocks
if(status.requests.length>0)
n.find("h4").text(r.domains.join(", "));
if(r.result=="agree-to-tos"){
// user needs to agree to Let's Encrypt's TOS
agree_to_tos_url_prompt=r.url;
$('#ssl_provision_p .btn').attr('disabled','1');
n.find("p").html("Please open and review <a href='"+r.url+"' target='_blank'>Let's Encrypt's terms of service agreement</a>. You must agree to their terms for a certificate to be automatically provisioned from them.");
// Show a button that counts down to zero, at which point it becomes enabled.
n.find("p").text("A certificate is now in the process of being provisioned, but it takes some time. Please wait until the Finish button is enabled, and then click it to acquire the certificate.");
// don't re-enable the Provision button -- user must use the Retry button when it becomes enabled
may_reenable_provision_button=false;
}elseif(r.result=="installed"){
n.find("p").addClass("text-success").text("The TLS certificate was provisioned and installed.");
setTimeout("show_tls(true)",1);// update main table of certificate statuses, call with arg keep_provisioning_shown true so that we don't clear what we just outputted
}
// display the detailed log info in case of problems