Try ERPNext Buy Support Partners Foundation Foundation Members

[Tutorial] How to setup a purchased SSL certificate on erpnext site

[1] Generate CSRs (Certificate Signing Requests)
[1.1]Login to server where erpnext is installed
[1.2] command to generate csr with private key

openssl req -new -newkey rsa:2048 -nodes -keyout shop.mydomain.com.key -out shop.mydomain.com.csr

[1.3] 2 files are generated in directory where above command is run. shop.mydomain.com.key and shop.mydomain.com.csr
[1.4]Open shop.mydomain.com.csr in nano/text editor and copy its content

[2] Provide CSR to godaddy or from where u r purchasing certificate
[2.1] Go to SSL->Domain–>Rekey–>Provide CSR
[2.2] Download certificate ex 5771137810388d5.crt
[2.3] Rename file to shop.mydomain.com.crt
Above steps will differ based on from where it is purchased.

[3] Install certificate on your ERPNext server
[3.1] Go to ERPNext server. Upload shop.mydomain.com.crt and shop.mydomain.com.key to /etc/nginx/conf.d/ssl/
[3.2] Commands to run
[3.2.1]Setup Multitenancy. Ref https://frappe.io/docs/user/en/bench/guides/setup-multitenancy

bench config dns_multitenant on
bench setup nginx
sudo service nginx reload

[3.2.2] Update site_config.json with path of certificate and key. Ref https://frappe.io/docs/user/en/bench/guides/configuring-https.html

bench set-ssl-certificate shop.mydomain.com /etc/nginx/conf.d/ssl/shop.mydomain.com.crt
bench set-ssl-key shop.mydomain.com /etc/nginx/conf.d/ssl/shop.mydomain.com.key
bench setup nginx
sudo service nginx reload

6 Likes

Awesome! Can you update docs if anything missing. https://frappe.io/docs/user/en/bench/guides/configuring-https

1 Like

@saurabh6790, i have created pull request https://github.com/frappe/frappe_io/pull/154.
Your steps are comprehensive and clear. I just added 2 things (a) CSR command (b) Prerequisite of multitenancy. Thanks