Skip to content

Instantly share code, notes, and snippets.

@ziizium
Created October 21, 2021 15:43
Show Gist options
  • Save ziizium/bab9f3b3a15a2afcc9d92e0dd8645c8b to your computer and use it in GitHub Desktop.
Save ziizium/bab9f3b3a15a2afcc9d92e0dd8645c8b to your computer and use it in GitHub Desktop.
How to create self-signed certificate with OpenSSL on Windows
# How to create a self-signed certificate with OpenSSL on Windows
* Download the OpenSSL libarary from https://slproweb.com/products/Win32OpenSSL.html
* Install it on your Windows Machine
* Add the OpenSSL folder to your system PATH by doing the following:
* Press and Hold `Windows key` and `R` to open the Run dialog box
* Type `sysdm.cpl` and press the Enter key
* Navigate to the `Advanced Tab` and click `Environmental Variables`
* Under `System variables`, select `Path` and click on `Edit`
* Click on `Browse` and locate the `bin` folder within the installation folder of OpenSSL, then add it
* Restart all Command Prompts (or Shell)
* Create a folder inside the `bin` folder of OpenSSL, prefreably, name it `SSL`
* Within this folder create two **empty** files, namely, `influxdb-selfsigned.crt` and `influxdb-selfsigned.key`
* Open a Command Prompt and execute the command: `openssl req -x509 -nodes -newkey rsa:2048 -keyout "C:\Program Files\OpenSSL-Win64\bin\SSL\influxdb-selfsigned.key" -out "C:\Program Files\OpenSSL-Win64\bin\SSL\influxdb-selfsigned.crt" -days 780`
* This command assumes that you installed the `64bit` version of OpenSSL within your `Program Files` directory
* Answer the questions to create your self-signed certificate and self-signed key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment