Skip to content

Creating Self Signed Certificates

Thomas edited this page Jul 13, 2018 · 1 revision

If you would like to run the Chainlink node with HTTPS enabled, you will need to place your key and certificate files in a directory that can be read by the node.

The command below will generate a server.crt and server.key file in the current directory.

openssl req -x509 -out server.crt  -keyout server.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=localhost' -extensions EXT -config <( \
   printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")

You will need to set the TLS_CERT_PATH and TLS_KEY_PATH environment variables to a directory accessible by the Chainlink node in order for HTTPS to work. For example, if your ROOT environment variable is /chainlink, then you could copy the files to a tls/ subdirectory and set the environment variables as:

TLS_CERT_PATH=/chainlink/tls/server.crt
TLS_KEY_PATH=/chainlink/tls/server.key