# Secure connection to Rstudio Server (https) not working

**URL:** <https://datashield.discourse.group/t/secure-connection-to-rstudio-server-https-not-working/606>\
**Category:** Beginner Support\
**Created:** [23 August 2022 05:31 UTC](https://datashield.discourse.group/t/secure-connection-to-rstudio-server-https-not-working/606 "2022-08-23T05:31:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilmar.igl](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@wilmar.igl](https://datashield.discourse.group/u/wilmar.igl)\
**Post date:** [23 August 2022 05:31 UTC](https://datashield.discourse.group/t/secure-connection-to-rstudio-server-https-not-working/606/1 "2022-08-23T05:31:39Z")

</div>

Hi,

I am trying to securely connect to my Rstudio server via https located at [https://srv1.stats-con.com:8787](https://srv1.stats-con.com:8787), however, I get this error on Firefox: Secure Connection Failed Error code: SSL\_ERROR\_RX\_RECORD\_TOO\_LONG

Connection via [http://srv1.stats-con.com:8787](http://srv1.stats-con.com:8787) works connecting to Rstudio (unsecure). Connection via [https://srv1.stats-con.com](https://srv1.stats-con.com) works, too, connecting to OPAL server (secure).

How do I have to configure my RStudio, NGINX, certificates (certbot, Lets encrypt)?

Best, Wilmar

---

<div class="post-metadata">

**Author:** ![yannick](https://yyz2.discourse-cdn.com/free1/user_avatar/datashield.discourse.group/yannick/32/19_2.png) [@yannick](https://datashield.discourse.group/u/yannick)\
**Post date:** [23 August 2022 11:44 UTC](https://datashield.discourse.group/t/secure-connection-to-rstudio-server-https-not-working/606/2 "2022-08-23T11:44:08Z")

</div>

`https` is configured for port 443. You should have a different subdomain (than `srv1`) for rstudio (like [rstudio.stats-con.com](http://rstudio.stats-con.com)) and a specific nginx config + let’s encrypt certificate as well.

Yannick

---

<div class="post-metadata">

**Author:** ![wilmar.igl](https://avatars.discourse-cdn.com/v4/letter/w/7993a0/32.png) [@wilmar.igl](https://datashield.discourse.group/u/wilmar.igl)\
**Post date:** [23 August 2022 19:18 UTC](https://datashield.discourse.group/t/secure-connection-to-rstudio-server-https-not-working/606/3 "2022-08-23T19:18:29Z")

</div>

Thanks!

1. I registered a new Typ A record of an domain address with a provider
2. I created a certificate with certbot:

> sudo certbot --nginx --cert-name [stats-con.com](http://stats-con.com) -d [srv1.stats-con.com](http://srv1.stats-con.com) -d [rstudio1.stats-con.com](http://rstudio1.stats-con.com)

1. I added a reverse proxy pointing to port 8787 in /etc/nginx/sites-available/default:

> location / {  
> proxy\_pass [http://127.0.0.1:8787/](http://127.0.0.1:8787/);  
> proxy\_set\_header Host $host;  
> }

Works! 🙂
