Let’s Encrypt免费SSL证书

获取Let’s Encrypt免费SSL证书

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

sudo ./letsencrypt-auto certonly –standalone –email admin@ccc.com -d aaa.bbb.ccc.com

失败


Skipping bootstrap because certbot-auto is deprecated on this system.
Your system is not supported by certbot-auto anymore.
Certbot cannot be installed.
Please visit https://certbot.eff.org/ to check for other alternatives.

原因需要安装 snap


sudo apt update
sudo apt install snapd -y

sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo apt install certbot -y
sudo apt-get install python-certbot-nginx
sudo certbot --nginx

生成证书:


certbot --nginx --email admin@ccc.com -d  www.ccc.com
certbot --nginx --register-unsafely-without-email ddd.ccc.com

 

 

https://www.cnblogs.com/sage-blog/p/10302934.html
https://zhuanlan.zhihu.com/p/53407930?from_voters_page=true
https://blog.51cto.com/lifeng/2564211
https://certbot.eff.org/lets-encrypt/ubuntubionic-nginx

 

advanced html5 fetch

https://streams.spec.whatwg.org/#blqs-class
https://jakearchibald.com/2016/streams-ftw/

 

 

fetch('/images/1.png').then((response) => {
  var totalBytes = response.headers.get('Content-Length'), bytesReceived = 0;
  var reader = response.body.getReader();
  var stream = new ReadableStream({
    start(controller) {
      function push() {
        reader.read().then(({ done, value }) => {
          if (done) {
            controller.close();
            return;
          }
    bytesReceived += value.length;
	var percent = Math.round(10000.0*bytesReceived / totalBytes) / 100.0;
    console.log(`Received ${bytesReceived} bytes of data so far, ${percent}%`);
          controller.enqueue(value);
          setTimeout(push,0);
        });
      };

      setTimeout(push,0);
    }
  });
  stream.tt = totalBytes;
  return new Response(stream, { headers: { "Content-Type": "image/png" } });
}).then(function(res){
  return res.arrayBuffer();
}).then(function(abuffer){
  console.log(['ok, result buffer is:',abuffer]);
}, function(a,b){console.log([a,b])});