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.
defcan_provision_for_domain(domain):
# Let's Encrypt doesn't yet support IDNA domains.
# We store domains in IDNA (ASCII). To see if this domain is IDNA,
# we'll see if its IDNA-decoded form is different.
ifidna.decode(domain.encode("ascii"))!=domain:
problems[domain]="Let's Encrypt does not yet support provisioning certificates for internationalized domains."
returnFalse
# Does the domain resolve to this machine in public DNS? If not,
# we can't do domain control validation. For IPv6 is configured,
# make sure both IPv4 and IPv6 are correct because we don't know
problems[domain]="DNS isn't configured properly for this domain: DNS resolution failed (%s: %s)."%(rtype,str(e)orrepr(e))# NoAnswer's str is empty
returnFalse
exceptExceptionase:
problems[domain]="DNS isn't configured properly for this domain: DNS lookup had an error: %s."%str(e)
returnFalse
iflen(response)!=1orstr(response[0])!=value:
problems[domain]="Domain control validation cannot be performed for this domain because DNS points the domain to another machine (%s %s)."%(rtype,", ".join(str(r)forrinresponse))
"message":"Something unexpected went wrong. It looks like your local Let's Encrypt account data is corrupted. There was a problem with the file "+e.account_file_path+".",
<p>A TLS (formerly called SSL) certificate is a cryptographic file that proves to anyone connecting to a web address that the connection is secure between you and the owner of that address.</p>
<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>
<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>There are many places where you can get a free or cheap SSL certificate. We recommend <ahref="https://www.namecheap.com/security/ssl-certificates/domain-validation.aspx">Namecheap’s $9 certificate</a>, <ahref="https://www.startssl.com/">StartSSL’s free express lane</a> or <ahref="https://buy.wosign.com/free/">WoSign’s free SSL</a></a>.</p>
<p>There are many places where you can get a free or cheap certificate. We recommend <ahref="https://www.namecheap.com/security/ssl-certificates/domain-validation.aspx">Namecheap’s $9 certificate</a>, <ahref="https://www.startssl.com/">StartSSL’s free express lane</a> or <ahref="https://buy.wosign.com/free/">WoSign’s free TLS</a></a>.</p>
<p>Which domain are you getting an SSL certificate for?</p>
<p>Which domain are you getting a certificate for?</p>
<p>What country are you in? This is required by some SSL certificate providers. You may leave this blank if you know your SSL certificate provider doesn't require it.</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>
<p>You will need to provide the SSL certificate provider this Certificate Signing Request (CSR):</p>
<p>You will need to provide the certificate provider this Certificate Signing Request (CSR):</p>
<preid="ssl_csr"></pre>
<p><small>The CSR is safe to share. It can only be used in combination with a secret key stored on this machine.</small></p>
<p>The SSL certificate provider will then provide you with an SSL certificate. They may also provide you with an intermediate chain. Paste each separately into the boxes below:</p>
<p>The certificate provider will then provide you with a TLS/SSL certificate. They may also provide you with an intermediate chain. Paste each separately into the boxes below:</p>
show_modal_error("SSL Certificate Installation","Certificate has been installed. Check that you have no connection problems to the domain.",function(){show_ssl();$('#csr_info').slideUp();});
show_modal_error("TLS Certificate Installation","Certificate has been installed. Check that you have no connection problems to the domain.",function(){show_ssl();$('#csr_info').slideUp();});
// 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
@@ -38,7 +38,7 @@ These services are protected by [TLS](https://en.wikipedia.org/wiki/Transport_La
The services all follow these rules:
*SSL certificates are generated with 2048-bit RSA keys and SHA-256 fingerprints. The box provides a self-signed certificate by default. The [setup guide](https://mailinabox.email/guide.html) explains how to verify the certificate fingerprint on first login. Users are encouraged to replace the certificate with a proper CA-signed one. ([source](setup/ssl.sh))
*TLS certificates are generated with 2048-bit RSA keys and SHA-256 fingerprints. The box provides a self-signed certificate by default. The [setup guide](https://mailinabox.email/guide.html) explains how to verify the certificate fingerprint on first login. Users are encouraged to replace the certificate with a proper CA-signed one. ([source](setup/ssl.sh))
* Only TLSv1, TLSv1.1 and TLSv1.2 are offered (the older SSL protocols are not offered).
* Export-grade ciphers, the anonymous DH/ECDH algorithms (aNULL), and clear-text ciphers (eNULL) are not offered.
* The minimum cipher key length offered is 112 bits. The maximum is 256 bits. Diffie-Hellman ciphers use a 2048-bit key for forward secrecy.