# SSL generation using API not working

**Project:** Bugs | **Board:** Live | **Votes:** 1
**URL:** https://roadmap.ploi.io/projects/7-bugs/items/870-ssl-generation-using-api-not-working

---

When using the API to create the SSL certificate, using the cloudflare credentials in the profile, the certificate is not created properly and gives an error on nginx. 
Screenshot of the error:
https://s.wpherc.com/2023/11/FsfY66YbxU.png
This is because the folder
etc/letsencrypt/live/domain.com  is empty in this case
https://s.wpherc.com/2023/11/HxebNpJJDr.png
The API returns no errors 
https://s.wpherc.com/2023/11/3SogL7sFce.png
And the gui shows the certificate in place:
https://s.wpherc.com/2023/11/BtniVSuhBb.png

But it does not work because NGINX error. 

The manual solution I found is to remove the certificate and create it manually using the gui. 
Then nginx -t is OK and the folder is correct:
https://s.wpherc.com/2023/11/h0scyVuoxO.png

The server on the screenshots in an example, please do not modify it.
Let me know if you need any more information.

Thanks
