diafygi / acme-tiny

A tiny script to issue and renew TLS certs from Let's Encrypt
MIT License
4.74k stars 572 forks source link

IOError: [Errno 2] #100

Closed 1a57danc3 closed 8 years ago

1a57danc3 commented 8 years ago

➜ ssl sudo python acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir ~/www/challenges/ > ./signed.crt sudo: unable to resolve host 133-130-123-49 Parsing account key... Parsing CSR... Registering account... Already registered! Verifying opengoogle.xyz... Traceback (most recent call last): File "acme_tiny.py", line 198, in 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) File "acme_tiny.py", line 111, in get_crt with open(wellknown_path, "w") as wellknown_file: IOError: [Errno 2] No such file or directory: u'/root/www/challenges/l2GESkW5CS61sboJjAFqkabLDymwVCFtQdfVxQfcy-s'

samuellb commented 8 years ago

I think you need to create the directory /root/www/challenges before you run acme-tiny

1a57danc3 commented 8 years ago

➜ ssl python acme_tiny.py --account-key ./account.key --csr ./domain.csr --acme-dir ~/www/challenges/ > ./signed.crt Parsing account key... Parsing CSR... Registering account... Already registered! Verifying opengoogle.xyz... Traceback (most recent call last): File "acme_tiny.py", line 198, in 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) File "acme_tiny.py", line 123, in get_crt wellknown_path, wellknown_url)) ValueError: Wrote file to /root/www/challenges/PwnTFUlZUwJtlnzmirgs9lSMhE4vjhyvzNbdQqN2U9k, but couldn't download http://opengoogle.xyz/.well-known/acme-challenge/PwnTFUlZUwJtlnzmirgs9lSMhE4vjhyvzNbdQqN2U9k

samuellb commented 8 years ago

Have you checked the web server error log and the web server configuration?

1a57danc3 commented 8 years ago

http://opengoogle.xyz/.well-known/acme-challenge/1.txt is 404

but nginx configuration is ok

location ^~ /.well-known/acme-challenge/ { alias /root/www/challenges/; try_files $uri =404; }

rspeed commented 8 years ago

Are you running this as root? You shouldn't need to. I see a sudo in the first post, but not in the second.

1a57danc3 commented 8 years ago

https://github.com/xdtianyu/scripts is ok.