Let us see how to configure SSL in localhost.
For installing OpenSSL in Windows, click here. After installing OpenSSL, the below steps are to be followed:
- Open command prompt as “Run as administrator”.
- Navigate the command prompt path to OpenSSL Install path upto bin folder.
Ex. C:\Program Files\OpenSSL-Win64\bin
- Type the following commmands
a. openssl genrsa -out client.key 2048
b. openssl rsa -in client.key -out client.key
c. openssl req -sha256 -new -key client.key -out client.csr -subj “/C={{COUNTRY NAME}}/ST={{STATE NAME}}/L={{CITY NAME}}/O={{ORGANIZATION NAME}}/OU={{ORGANIZATION UNIT NAME}}/CN={{COMMON NAME}}”Parameters Explanation:
Country Name: Must be a 2 letter Country Code. Ex: AU
State Name: Your State Name, mentioned in Full Name
City Name: Your City Name
Organization Name: Your Company Name
Organization Unit Name: Your Company Unit Name
Common Name: localhost or Your IP. If you are using sub domain, please contact sub domain
Ex: openssl req -sha256 -new -key client.key -out client.csr -subj “/C=IN/ST=Tamil Nadu/L=Sivakasi/O=Test/OU=IT Development/CN=localhost”
d. openssl x509 -req -sha256 -days 365 -in client.csr -signkey client.key -out client.crt
- Now, “client.key”, “client.crt”, “client.csr” files are generated in the bin folder present in the OpenSSL installed path.
- Copied that 3 files in “{{OUTPUTDESK PACKAGE INSTALL PATH}}/public/ssl” folder. (If ssl folder not exists, create SSL folder under public folder)
- Open “client.js” file under “{{OUTPUTDESK PACKAGE INSTALL PATH}}/public/config” (If config folder not exists, create config folder under public folder and create new file as “client.js”)
- Set httpsport and ssl configuration file path
global.httpsPort = 8235;
global.privateKey= “{{OUTPUTDESK PACKAGE INSTALL PATH}}/public/ssl/client.key”;
global.certificate = “{{OUTPUTDESK PACKAGE INSTALL PATH}}/public/ssl/client.crt”;
global.intermediate1 = “{{OUTPUTDESK PACKAGE INSTALL PATH}}/public/ssl/client.csr”;
- Stop & Start “Output Desk” services to check https://localhost