# Windows SSL Certificate

**URL:** <https://discourse.nodered.org/t/windows-ssl-certificate/68104>\
**Category:** General\
**Tags:** security\
**Created:** [23 September 2022 00:02 UTC](https://discourse.nodered.org/t/windows-ssl-certificate/68104 "2022-09-23T00:02:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danmiles86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/danmiles86/32/68185_2.png) [@danmiles86](https://discourse.nodered.org/u/danmiles86)\
**Post date:** [23 September 2022 00:02 UTC](https://discourse.nodered.org/t/windows-ssl-certificate/68104/1 "2022-09-23T00:02:03Z")

</div>

Sorry noob here....

Been using NodeRed on my Windows machine for ages now and all been good. But I now need to expose it to the big wide internet so need to make sure I have SSL enabled. However I cannot get it to work and have been trying for weeks now.

Does any one know of a walk through I could follow?

If not my attempts are around using CertifyTheWeb client to generate certificates which seems to all go well. I save them in a certs folder in my .nodered directory and update the config file. However when I go to restart NodeRed it just instantly crashes.

Totally stuck!

```auto
    /** Option 1: static object */
    https: {
      key: require("fs").readFileSync('C:\Users\HT\.node-red\certs\privkey.pem'),
      cert: require("fs").readFileSync('C:\Users\HT\.node-red\certs\fullchain.pem')
    },

```

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [23 September 2022 11:53 UTC](https://discourse.nodered.org/t/windows-ssl-certificate/68104/2 "2022-09-23T11:53:54Z")

</div>

`\` is an escape character in JavaScript strings so you need `\\`. But easier is to use `/` instead which windows is perfectly happy with. Even better is to use the `path` library which is native node.js e.g. `path.join(os.homedir(), 'folder1', folder2', 'fullchain.cer')`. That sorts out paths for you, works across different OS's and even takes care of relative paths and `.` or `..` mixed in.

---

<div class="post-metadata">

**Author:** ![danmiles86](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/danmiles86/32/68185_2.png) [@danmiles86](https://discourse.nodered.org/u/danmiles86)\
**Post date:** [23 September 2022 14:12 UTC](https://discourse.nodered.org/t/windows-ssl-certificate/68104/3 "2022-09-23T14:12:32Z")

</div>

Thank you! Can confirm that fixed it

Appreciate you taking the time to answer as I would have been there forever figuring that one out.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [7 October 2022 14:12 UTC](https://discourse.nodered.org/t/windows-ssl-certificate/68104/4 "2022-10-07T14:12:53Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
