https://www.oschina.net/news/94188/acme-v2-and-wildcard-certificate-support-is-live https://my.oschina.net/kimver/blog/1634575 https://github.com/Neilpang/acme.sh/wiki/%E8%AF%B4%E6%98%8E ## Nginxåå代çhttpçtomcat 1,æ§è¡ curl https://get.acme.sh | sh 2,æ§è¡ source ~/.bashrc 3,æ§è¡ # é¿éäºåå°çå¯é¥ export Ali_Key="1858118" export Ali_Secret="1858118" # å¡«åèªå·±çåå acme.sh --issue --dns dns_ali -d springboot.io -d *.springboot.io * acme.shæ¯certbotçæ¹å¼æ´å èªå¨å,çå»äºæå¨å»åååå°æ¹DNSè®°å½çæ¥éª¤,èä¸ä¸ç¨ä¾èµPython * ç¬¬ä¸æ¬¡æåä¹å,acme.shä¼è®°å½ä¸App_Keyè·App_Secret,å¹¶ä¸çæä¸ä¸ªå®æ¶ä»»å¡,æ¯å¤©åæ¨0ï¼00èªå¨æ£æµè¿æååå¹¶ä¸èªå¨ç»æ * 对è¿ç§æ¹å¼æé¡¾èç,请æ é,ä¸è¿ä¹å¯ä»¥èªè¡å æç¨æ·çº§ç宿¶ä»»å¡,并䏿¸ çæ~/.acme.shæä»¶å¤¹å°±è¡ 4,å¨è¯ä¹¦çæç®å½æ§è¡ acme.sh --installcert -d springboot.io -d *.springboot.io \ --keypath /usr/local/ssl/springboot/springboot.io.key \ --fullchainpath /usr/local/ssl/springboot/springboot.io.pem * 伿keyåpemçæå°æå®çç®å½ 5,é ç½®nginx server { listen 443; server_name springboot.io www.springboot.io; ssl on; ssl_certificate /usr/local/ssl/springboot/springboot.io.pem; ssl_certificate_key /usr/local/ssl/springboot/springboot.io.key; access_log logs/springboot.io.log main; error_log logs/springboot.io.error.log; proxy_set_header Host $host; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Requested-For $remote_addr; proxy_set_header REMOTE-HOST $remote_addr; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; location / { proxy_pass http://127.0.0.1:1024; proxy_connect_timeout 600; proxy_read_timeout 600; } } server { listen 80; server_name springboot.io www.springboot.io; return 301 https://springboot.io$request_uri; } ## Springbootåç¬é ç½® 1,(å¨è¯ä¹¦çæç®å½)çækeystore * çæ p12 æä»¶(ä¼è¾å ¥ä¸æ¬¡å¯ç ) openssl pkcs12 -export -in fullchain.cer -inkey springboot.io.key -out springboot.io.p12 * æ ¹æ®p12 æä»¶çæ keystore æä»¶ keytool -importkeystore -v -srckeystore springboot.io.p12 -srcstoretype pkcs12 -srcstorepass [p12æä»¶çå¯ç ] -destkeystore springboot.io.keystore -deststoretype jks -deststorepass [keytroeçå¯ç ] * 妿æç¤ºè¦å,å¯ä»¥èèæ ¹æ®è¦åçå½ä»¤,åæ§è¡ä¸æ³¢ keytool -importkeystore -srckeystore springboot.io.keystore -destkeystore springboot.io.keystore -deststoretype pkcs12 2,springbooté ç½® #ssl server.ssl.enabled=true server.ssl.key-store=classpath:ssl/springboot.io.keystore server.ssl.key-store-type=PKCS12 server.ssl.key-store-password=[key.storeçå¯ç ] ------------------------------------ æå¨å®è£ åååè¯ä¹¦ | ------------------------------------ 1,clone git clone [email protected]:certbot/certbot.git 2,çæè¯ä¹¦ * å¨å½åæå¡å¨çæ(standalone)建议 ./letsencrypt-auto certonly --standalone --email [é®ç®±] -d [åå] -d [åå] * éå½åæå¡å¨ä¸çæ(manual) ./letsencrypt-auto certonly --manual --email [é®ç®±] -d [åå] -d [åå] * éè¦å¨æå¡å¨çä¸å®è£ å¯è®¿é®ç,èæ¬æä¾çææ¬ CjhdUm0L4oQU0ZHg7F7832FtFweUPlRFJs0LxJGx_qg.-ielpqOUtyZI_Q0f9xYi8-Bj57TsuD5y4mGIMxW9GwM ææ¬ http://[åå]/.well-known/acme-challenge/CjhdUm0L4oQU0ZHg7F7832FtFweUPlRFJs0LxJGx_qg 访é®å°å * æ§è¡æé´ä¼ä¸æ§å¶å°æä¸¤æ¬¡äº¤äº,ç¬¬ä¸æ¬¡è¾å ¥A,表示åæåè®®,ç¬¬äºæ¬¡è¾å ¥YES,表示å 许ä»ä»¬æ¶éä½ çé®ç®± * å建æé´,å¿ é¡»ä¿è¯80端å£ä¸è¢«å ç¨,èæ¬ä¼å¨80端å£å¯å¨httpæå¡æ¥éªè¯ååæå±(standalone) * å建æååä¼å¨ /etc/letsencrypt/ ä¸çæè¯ä¹¦æä»¶ * 妿éå°å 为 pip 带æ¥çå¼å¸¸,å°è¯å é¤(建议éå½åå¤ç) ~/.pip/pip.conf æä»¶ * è®°å¾å®å ¨ç»/é²ç«å¢å¼æ¾80ç«¯å£ 3,è¯ä¹¦ç»çº¦(éè¦å¨çæè¯ä¹¦çæå¡å¨ä¸è¿è¡) ./letsencrypt-auto renew Saving debug log to /var/log/letsencrypt/letsencrypt.log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Processing /etc/letsencrypt/renewal/springcloud.io.conf(å¤ç/etc/letsencrypt/renewal/springcloud.io.conf) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cert not yet due for renewal(è¯ä¹¦è¿æ²¡æå°æ) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The following certs are not due for renewal yet:(ä¸åè¯ä¹¦å°æªå°æç»æ) /etc/letsencrypt/live/springcloud.io/fullchain.pem expires on 2018-11-29 (skipped) No renewals were attempted.(没æå°è¯æ´æ°) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # nginxé ç½® ssl on; ssl_certificate /etc/letsencrypt/live/[åå]/fullchain.pem ssl_certificate_key /etc/letsencrypt/live/[åå]/privkey.pem # 转æ¢ä¸º tomcat çæ ¼å¼ 1,è¿å ¥ç®å½ /etc/letsencrypt/live/[åå]/ æ§è¡ openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out [åå].p12 * çæ p12 æä»¶(ä¼è¾å ¥ä¸æ¬¡å¯ç ) 2,æ ¹æ®p12 æä»¶çæ keystore æä»¶ keytool -importkeystore -v -srckeystore [åå].p12 -srcstoretype pkcs12 -srcstorepass [p12æä»¶çå¯ç ] -destkeystore [åå].keystore -deststoretype jks -deststorepass [keytroeçå¯ç ] * 妿æç¤ºè¦å,å¯ä»¥èèå¤å¶è¦åçå½ä»¤,åæ§è¡ä¸æ³¢ keytool -importkeystore -srckeystore [åå].keystore -destkeystore [åå].keystore -deststoretype pkcs12 ------------------------------------ æå¨å®è£ æ³ååè¯ä¹¦ | ------------------------------------ 1,ä¸è½½ wget https://dl.eff.org/certbot-auto chmod 775 certbot-auto * ä¹å¯éç¨certbot宿¹ yumå®è£ æ¹å¼ 2,æ§è¡ ./certbot-auto certonly -d *.example.com -d example.com --manual --email [é®ç®±] --preferred-challenges dns --server https://acme-v02.api.letsencrypt.org/directory * å ¶å®å°±æ¯è·ä¸é¢çé£ç§æ¹æ³ä¸æ ·,éç¨çæ¯,éå½åæå¡å¨ä¸çæ(manual) 3,æ·»å TXTè§£æè®°å½å°dnsæå¡å¨,æ·»å 宿å,çå¾ è¯ä¹¦çæ,çæå * å建æååä¼å¨ /etc/letsencrypt/ ä¸çæè¯ä¹¦æä»¶ * è·æå¨å建åååè¯ä¹¦ä¸æ ·ç 4,æ´æ°è¯ä¹¦ ./certbot-auto renew ------------------------------------ å¨çº¿è¯ä¹¦è½¬æ¢å·¥å · | ------------------------------------ https://myssl.com/