注册证书502
来源:16-3 申请免费https证书 和 上程序送审步骤
szuxxy
2020-07-08
[root@VM_0_6_centos ssl]# python acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir /var/challenges/ > ./signed.crt
Parsing account key...
Parsing CSR...
Found domains: www.zmfei4.com
Getting directory...
Directory found!
Registering account...
Registered!
Creating new order...
Order created!
Verifying www.zmfei4.com...
Traceback (most recent call last):
File "acme_tiny.py", line 198, in <module>
main(sys.argv[1:])
File "acme_tiny.py", line 194, in main
signed_crt = get_crt(args.account_key, args.csr, args.acme_dir, log=LOGGER, CA=args.ca, disable_check=args.disable_check, directory_url=args.directory_url, contact=args.contact)
File "acme_tiny.py", line 143, in get_crt
raise ValueError("Wrote file to {0}, but couldn't download {1}: {2}".format(wellknown_path, wellknown_url, e))
ValueError: Wrote file to /var/challenges/eLc17S8BEiX7MswVSqW0DlbaK1yZBlKtoBZU6h73Jbs, but couldn't download http://www.zmfei4.com/.well-known/acme-challenge/eLc17S8BEiX7MswVSqW0DlbaK1yZBlKtoBZU6h73Jbs: Error:
Url: http://www.zmfei4.com/.well-known/acme-challenge/eLc17S8BEiX7MswVSqW0DlbaK1yZBlKtoBZU6h73Jbs
Data: None
Response Code: 502
Response: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>
其中也是有目录/var/challenges的:
[root@VM_0_6_centos ssl]# cd /var/challenges/
[root@VM_0_6_centos challenges]# ll
total 20
-rwxr-xr-x 1 root root 5 Mar 26 14:38 demo.txt
-rw-r--r-- 1 root root 87 Jul 8 05:06 eLc17S8BEiX7MswVSqW0DlbaK1yZBlKtoBZU6h73Jbs
-rw-r--r-- 1 root root 87 Jul 8 04:28 H-Y7i8LOx04dw643EydonIs5ftY-5TJOWgE_BfIw8WU
-rwxr-xr-x 1 root root 87 Mar 27 19:39 Jp2rwL4pMwmt2j8uYngQweFZBLFNgQ-7e8rifH8PWNQ
-rw-r--r-- 1 root root 87 Jul 8 04:08 tce2hlFr0MnIzmNwNVTr02y7z4TL3J2Zek7UPMpIn_U
发现小程序拿不到数据,然后重新弄https证书,出现上面的错误。
回复老师1:
我把把以前的location注释了,加入了您这边说的:
server{
listen 80 default_server;
listen 443 default ssl;
server_name www.zmfei4.com;
ssl_certificate /root/ssl/chained.pem;
ssl_certificate_key /root/ssl/domain.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
ssl_session_cache shared:SSL:50m;
ssl_prefer_server_ciphers on;
# location /{
# proxy_pass http://127.0.0.1:8889/;
# #index index.html index.htm;
# }
location /.well-known/acme-challenge/ {
alias /var/challenges/;
try_files $uri =404;
}
}
依旧还是会报这个错。
写回答
2回答
-
编程浪子
2020-07-09
你好
根据你的日志,我访问文件,直接80无法访问,你的服务启动?

证书没有生成之前,不要配置443的相关东西
00 -
编程浪子
2020-07-08
你好
你看看你的nginx 有咩有配置对
location /.well-known/acme-challenge/ { alias /var/challenges/; try_files $uri =404; }012020-07-08
相似问题
