Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 1.37 KB

Generate Key Certificate Pair for CustomSSL Authentication in ODK Server.md

File metadata and controls

34 lines (28 loc) · 1.37 KB

Problem

Usually websites(in our case ODK server) requires key and certificate pairs from the domain provider for SSL authentication. In case we dont have any secure ssl docmain generated how can we encrypt a website in a custom way?

Environment

Docker, Ubuntu, ODK Server

How you fix it

The customSSL for a website can be generated by providing just some basic information using OpenSSL. Openssl generates custom key certificate pair that we can use for encrypting any website.

Solution

Generating KEY VALUE Pair using OpenSSL

Download and install OpenSSL and then execute the following commands for generating key certificate pair

'sudo apt install openssl',  
'openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365',  

The prompt asks for Country,Province,Company Name, Email Address etc and generates the key certificate pair in current directory.

Copy the contents to proper directory and update .env file.

Copy those files into files/local/customssl/ within the repository root. Update the contents of .env file as follows In .env file set the following content:

'DOMAIN YOUR_DOMAIN',  
'SYSADMIN_EMAIL YOUR_EMAIL_ADDRESS',
'SSL_TYPE customssl',  
'HTTP_PORT 80',  
'HTTPS_PORT 443',  

Yippee, that sets the contents for certificate validation properly, now the ODK server webpage is encrypted and can deployed under docker.