# Server WebSocket

**URL:** <https://community.letsencrypt.org/t/server-websocket/213884>\
**Category:** Help\
**Created:** [February 25, 2024, 3:54am UTC](https://community.letsencrypt.org/t/server-websocket/213884 "2024-02-25T03:54:04Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [February 27, 2024, 3:02pm UTC](https://community.letsencrypt.org/t/server-websocket/213884/21 "2024-02-27T15:02:38Z")

</div>

I've already launched IIS while conducting experiments.  
Now I'll turn it off. Currently, I'll try the Webprofusion path.

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [February 27, 2024, 3:05pm UTC](https://community.letsencrypt.org/t/server-websocket/213884/22 "2024-02-27T15:05:00Z")

</div>

Then we are all agreed 🙂

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [February 28, 2024, 4:37am UTC](https://community.letsencrypt.org/t/server-websocket/213884/23 "2024-02-28T04:37:20Z")

</div>

Hello friends. Should I run certbot.exe on the server or locally on my computer? My site became visible as [his-name.com](http://his-name.com).

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [February 28, 2024, 5:00am UTC](https://community.letsencrypt.org/t/server-websocket/213884/24 "2024-02-28T05:00:35Z")

</div>

OPS!!!!

Successfully received certificate.  
Certificate is saved at: C:\Certbot\live\his-name.com\fullchain.pem  
Key is saved at: C:\Certbot\live\his-name.com\privkey.pem  
This certificate expires on 2024-05-28.  
These files will be updated when the certificate renews.  
Certbot has set up a scheduled task to automatically renew this certificate in the background.

* * *

If you like Certbot, please consider supporting our work by:

- Donating to ISRG / Let's Encrypt: [Donate - Let's Encrypt](https://letsencrypt.org/donate)
- Donating to EFF: [Support EFF's Work on Let's Encrypt | Electronic Frontier Foundation](https://eff.org/donate-le)

* * *

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [February 28, 2024, 5:01am UTC](https://community.letsencrypt.org/t/server-websocket/213884/25 "2024-02-28T05:01:27Z")

</div>

It seems I managed to do it!

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [February 28, 2024, 5:03am UTC](https://community.letsencrypt.org/t/server-websocket/213884/26 "2024-02-28T05:03:31Z")

</div>

Curious, are these certificates already in the right place, or do I need to move them somewhere and somehow so they work for HTTPS? (Windows Server 2019) (IIS)

---

<div class="post-metadata">

**Author:** ![webprofusion](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/webprofusion/32/85310_2.png) [@webprofusion](https://community.letsencrypt.org/u/webprofusion)\
**Post date:** [February 28, 2024, 7:52am UTC](https://community.letsencrypt.org/t/server-websocket/213884/27 "2024-02-28T07:52:09Z")

</div>

Now that you have your certificate, deploying it involves telling anything that's going to use it that it exists and where to find it.

So for you the next step is to tell your node server where to pick up the files from (use the key file and the fullchain.pem file):

> **[How to Secure WebSocket Connections in Node.js: A Step-by-Step Guide](https://medium.com/@innovativejude.tech/how-to-secure-websocket-connections-in-node-js-a-step-by-step-guide-6d983a07bd96)**
>
> Introduction:

You may need to adjust the file permissions so your process can read the certificate files, or you may not.

---

<div class="post-metadata">

**Author:** ![webprofusion](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/webprofusion/32/85310_2.png) [@webprofusion](https://community.letsencrypt.org/u/webprofusion)\
**Post date:** [February 28, 2024, 7:53am UTC](https://community.letsencrypt.org/t/server-websocket/213884/28 "2024-02-28T07:53:33Z")

</div>

If you did decide to use them with IIS (_not your node server_) that's a different process but from what I can tell you don't really want/need to use IIS at all.

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [March 1, 2024, 3:04am UTC](https://community.letsencrypt.org/t/server-websocket/213884/29 "2024-03-01T03:04:42Z")

</div>

Hello friends. Now there's another issue. The certificates state that they cannot be moved (WARNING: DO NOT MOVE OR RENAME THESE FILES!  
Certbot expects these files to remain in this location in order  
to function properly!) , but in order for IIS to recognize them, I need to install them through the IIS Manager, and they need to be in the form of a PFX file, which I don't have.

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [March 1, 2024, 4:03am UTC](https://community.letsencrypt.org/t/server-websocket/213884/30 "2024-03-01T04:03:03Z")

</div>

Wow! [https://his-name.com/](https://his-name.com/) EZ!

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [March 1, 2024, 5:33am UTC](https://community.letsencrypt.org/t/server-websocket/213884/31 "2024-03-01T05:33:10Z")

</div>

So, friends, everything is working as expected. Here's what was done: I used IIS to create a website, then obtained a certificate with Certbot. Using OpenSSL, I created a PFX file, which was uploaded to the IIS certificates. These same certificates were used in the JavaScript code for WSS connection. And the connection is established:

**socket = new WebSocket("wss://his-name.com:3300");**

Everything connects properly. Thanks to everyone for the help.

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [March 1, 2024, 5:47am UTC](https://community.letsencrypt.org/t/server-websocket/213884/32 "2024-03-01T05:47:38Z")

</div>

I substituted the same .crt and .key files in my JavaScript code that were used for importing into IIS.

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [March 1, 2024, 10:49am UTC](https://community.letsencrypt.org/t/server-websocket/213884/33 "2024-03-01T10:49:01Z")

</div>

> [@andrys](#):
>
> Using OpenSSL, I created a PFX file

LE certs last only 90 days.  
Are you able to automate the renewals?  
If not, then you may need to reconsider your solution.

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [March 1, 2024, 10:55am UTC](https://community.letsencrypt.org/t/server-websocket/213884/34 "2024-03-01T10:55:18Z")

</div>

Most likely, this will be done manually. But I think it's possible to pause for technical maintenance once every three months.

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [March 1, 2024, 11:01am UTC](https://community.letsencrypt.org/t/server-websocket/213884/35 "2024-03-01T11:01:14Z")

</div>

I think that Let's has a paid certificate for a year. So, after three months, I'll switch to the paid one. By the way, is there a free one for a year?

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [March 1, 2024, 11:03am UTC](https://community.letsencrypt.org/t/server-websocket/213884/36 "2024-03-01T11:03:21Z")

</div>

But you could better automate the process by using a Windows ACME client.  
And already mentioned twice before:

> [@webprofusion](#):
>
> using [https://certifytheweb.com](https://certifytheweb.com)

> [@rg305](#):
>
> Like: [https://CertifyTheWeb.com/](https://CertifyTheWeb.com/)

OR you could place your app behind a proxy that was easier to integrate with automation.  
Also mentioned before:

> [@rg305](#):
>
> Can it be used behind a proxy?

> [@webprofusion](#):
>
> Here is an article discussing how you could just use IIS as the front end for your service but keep express running on a higher port behind the scenes. This simplifies your certificate renewals (you otherwise need to prepare your certificate files where express can see them, then restart express to pick them up).  
> [IIS As Reverse Proxy To WebSocket Server | by Adrian Jenkins | Medium](https://adrianjnkns.medium.com/iis-as-reverse-proxy-to-websocket-server-c4fb5a7166f5)

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [March 1, 2024, 11:05am UTC](https://community.letsencrypt.org/t/server-websocket/213884/37 "2024-03-01T11:05:10Z")

</div>

> [@andrys](#):
>
> I think that Let's has a paid certificate for a year. So, after three months, I'll switch to the paid one. By the way, is there a free one for a year?

LE only provides FREE certs.  
All LE certs last only 90 days [no longer, no shorter].

Note: There are plans of offering certs with much shorter life.  
There are NO plans of offering a cert with longer life.

Why would you want to pay for something that you can get for FREE?  
All you need to figure out is the automation.

---

<div class="post-metadata">

**Author:** ![andrys](https://avatars.discourse-cdn.com/v4/letter/a/c68b51/32.png) [@andrys](https://community.letsencrypt.org/u/andrys)\
**Post date:** [March 1, 2024, 11:38am UTC](https://community.letsencrypt.org/t/server-websocket/213884/38 "2024-03-01T11:38:21Z")

</div>

I'm still familiarizing myself with this article ([IIS As Reverse Proxy To WebSocket Server | by Adrian Jenkins | Medium](https://adrianjnkns.medium.com/iis-as-reverse-proxy-to-websocket-server-c4fb5a7166f5)).

---

<div class="post-metadata">

**Author:** ![webprofusion](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/webprofusion/32/85310_2.png) [@webprofusion](https://community.letsencrypt.org/u/webprofusion)\
**Post date:** [March 2, 2024, 3:22am UTC](https://community.letsencrypt.org/t/server-websocket/213884/39 "2024-03-02T03:22:59Z")

</div>

If Certify The Web doesn't really appeal to you there is also win-acme or Posh-ACME which are both popular tools on Windows which produce PFX and/or PEM files.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [April 1, 2024, 3:23am UTC](https://community.letsencrypt.org/t/server-websocket/213884/40 "2024-04-01T03:23:44Z")

</div>

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

[Previous page](https://community.letsencrypt.org/t/server-websocket/213884.md?page=1)
