# Error: \[Errno 22\] Signing the new certificate failed

**URL:** https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842
**Category:** Support
**Tags:** english
**Created:** [May 13, 2018, 2:34am UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842 "2018-05-13T02:34:53Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [May 13, 2018, 2:34am UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/1 "2018-05-13T02:34:54Z")

</div>

Hi  
Renew of the Lets Encrypt certificate failed.  
yunohost:  
repo: local  
version: 2.7.13.1  
yunohost-admin:  
repo: testing  
version: 2.7.13  
moulinette:  
repo: stable  
version: 2.7.12  
ssowat:  
repo: stable  
version: 2.7.12

```
Applying pending configuration for service 'dnsmasq'...
The configuration file '/etc/resolv.dnsmasq.conf' has been backed up to '/home/yunohost.conf/backup/etc/resolv.dnsmasq.conf-XXXXXXXXXXX'
The configuration file '/etc/resolv.dnsmasq.conf' has been updated
Success! The configuration has been updated for service 'dnsmasq'
Executing script '/usr/share/yunohost/hooks/conf_regen/43-dnsmasq'...
+ set -e
+ FORCE=0
+ DRY_RUN=0
+ case "$1" in
+ do_post_regen /etc/resolv.dnsmasq.conf
+ regen_conf_files=/etc/resolv.dnsmasq.conf
+ [[-z /etc/resolv.dnsmasq.conf]]
+ sudo service dnsmasq restart
+ exit 0
Prepare key and certificate signing request (CSR) for domain.tld...
Saving to /tmp/acme-challenge-private/domain.tld.csr.
Now using ACME Tiny to sign the certificate...
Parsing account key...
Parsing CSR...
Found domains: domain.tld
Getting directory...
Directory found!
Registering account...
Error: 'newAccount'
Error: Certificate renewing for domain.tld failed !
Error: Traceback (most recent caall last):
  File "/usr/lib/moulinette/yunohost/certificate.py", line 381, in certificate_renew
    _fetch_and_enable_new_certificate(domain, staging)
  File "/usr/lib/moulinette/yunohost/certificate.py", line 573, in _fetch_and_enable_new_certificate
    'certmanager_cert_signing_failed'))
MoulinetteError: [Errno 22] Signing the new certificate failed

Error: [Errno 22] Signing the new certificate failed
```

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [May 13, 2018, 9:07am UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/2 "2018-05-13T09:07:39Z")

</div>

Weeeeell 😕

Are you using `--no-checks` here ? (I guess not if that’s the default cron job)

Is you server correctly accessible on port 80 via the domain name ?

Are you able to reproduce the issue ?

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [May 13, 2018, 6:12pm UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/3 "2018-05-13T18:12:17Z")

</div>

I have tried with --no-checks too.  
How can I check port is accessible on port 80.

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [May 13, 2018, 6:32pm UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/4 "2018-05-13T18:32:23Z")

</div>

Just by trying to access your server in http from your browser

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [May 13, 2018, 6:38pm UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/5 "2018-05-13T18:38:29Z")

</div>

But trying to access my domain with http takes me to https as default behavior which works normal as it should do.

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [May 13, 2018, 6:51pm UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/6 "2018-05-13T18:51:02Z")

</div>

Did you see this? Its trying to create new account, its normal?

> [@kanhu](#):
>
> Error: ‘newAccount’  
> Error: Certificate renewing for domain.tld failed !

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [May 19, 2018, 10:21am UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/7 "2018-05-19T10:21:11Z")

</div>

The error have changed itself, I don’t know how.

```
Error: Wrote file to /tmp/acme-challenge-public/QZRZbdSTnTkl0lf6W-ig6OoZhxt6a5hOG-KFaITwDEM, but couldn't download http://domain.tld/.well-known/acme-challenge/QZRZbdSTnTkl0lf6W-ig6OoZhxt6a5hOG-KFaITwDEM
Warning: Debug information:
 - domain ip from DNS xxx.xxx.x.xxx
 - domain ip from local DNS xxx.xxx.x.xxx
 - public ip of the server xxx.xxx.x.xxx

```

edited: There was some conflict with the .well-known location in the nginx configuration. Rectifying it solved the issue.

---

<div class="post-metadata">

### Author: ![jmendoza](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@jmendoza](https://forum.yunohost.org/u/jmendoza)
#### Post date: [June 2, 2018, 8:14pm UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/8 "2018-06-02T20:14:18Z")

</div>

Hi Kanhu! I get the same error. The --no-checks option results in two warnings with debug information, which show different values for “domain ip from DNS”.

- May I ask, how did solve the “conflict with the .well-known location in the nginx configuration”?

---

<div class="post-metadata">

### Author: ![kanhu](https://forum.yunohost.org/user_avatar/forum.yunohost.org/kanhu/32/3518_2.png) [@kanhu](https://forum.yunohost.org/u/kanhu)
#### Post date: [June 2, 2018, 8:27pm UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/9 "2018-06-02T20:27:23Z")

</div>

@jmendoza  
Hello  
You should have the domain ip matching with your YunoHost server. My domain ip(which are marked as XX.XX.XX.XX are marked for privacy) was matching with YunoHost server ip. If that are not matching you have to configure your DNS first.

Now if the ip is matching and then there is an error. You should see the app.conf files under /etc/nginx/conf.d/domanin.tld.d/app.conf and look for .well-known locations and comment them for the sake of the renewing of the certificate.

After that restart nginx :`service nginx restart` and then `yunohost domain cert-renew domain.tld`  
You can uncomment the .well-known lines form the app.conf and restart nginx again.

---

<div class="post-metadata">

### Author: ![jmendoza](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/j/9dc877/32.png) [@jmendoza](https://forum.yunohost.org/u/jmendoza)
#### Post date: [June 3, 2018, 7:17am UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/10 "2018-06-03T07:17:51Z")

</div>

Thanks a lot for the explanation Kanhu, very clear. I have followed your recommendations, but still no luck. Perhaps the root of the problem is that my ISP blocks ports, as I explain [here](https://forum.yunohost.org/t/own-domain-issues-on-namecheap-to-yunohost/4867/12) (I don’t want to raise my issue in two different threads, to respect you and the community ;-). I will continue trying, thanks for your response anyway!

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [January 18, 2023, 8:18pm UTC](https://forum.yunohost.org/t/error-errno-22-signing-the-new-certificate-failed/4842/11 "2023-01-18T20:18:09Z")

</div>


