# Stuck in letsencrypt ssl integration on Ubuntu

**URL:** <https://community.letsencrypt.org/t/stuck-in-letsencrypt-ssl-integration-on-ubuntu/90149>\
**Category:** Server\
**Created:** [April 2, 2019, 8:31am UTC](https://community.letsencrypt.org/t/stuck-in-letsencrypt-ssl-integration-on-ubuntu/90149 "2019-04-02T08:31:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![filipkrasniqi](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@filipkrasniqi](https://community.letsencrypt.org/u/filipkrasniqi)\
**Post date:** [April 2, 2019, 8:31am UTC](https://community.letsencrypt.org/t/stuck-in-letsencrypt-ssl-integration-on-ubuntu/90149/1 "2019-04-02T08:31:20Z")

</div>

Good morning,  
I am new in the community, glad to be one of you. It’s the first time I setup SSL, I chose to use letsencrypt.

I have an Angular application running on https, and that is working. I also have REST APIs implemented in NodeJS, and I am stuck on being able to provide them securely. The service is running on port 8443, and if I disable the certificate request they work (this to explain that no change to the code should be done).

The NodeJS code is as follows:

const privateKey = fs.readFileSync(\<path\_to\_privkey.pem\>, ‘utf8’);  
const certificate = fs.readFileSync(\<path\_to\_cert.pem\>, ‘utf8’);  
const ca = fs.readFileSync(\<path\_to\_chain.pem\>, ‘utf8’);

let activateHttps = true;

const credentials = {  
key: privateKey,  
cert: certificate,  
ca: ca,  
requestCert: activateHttps,  
rejectUnauthorized: activateHttps  
};

APIs are accessed with https://:8443/api/. Routing is implemented in NodeJS.

The configuration on sites-enabled/000-default.conf is as follows:

LoadModule ssl\_module libexec/apache2/mod\_ssl.so  
\<VirtualHost _:_\>  
ServerName   
ServerAlias   
\<Directory /var/www/html\>  
Options Indexes FollowSymLinks MultiViews  
AllowOverride All  
Require all granted  
  
DocumentRoot /var/www/html  
ErrorLog {APACHE\_LOG\_DIR}/error.log CustomLog {APACHE\_LOG\_DIR}/access.log combined  
ProxyPreserveHost On  
SSLEngine on  
SSLCertificateFile \<path\_to\_cert\>  
SSLCertificateKeyFile \<path\_to\_key\>  
SSLCertificateChainFile \<path\_to\_chain\>  
\<Location /api\>  
ProxyPass https://:8443/api #tried redirect but not working!  
ProxyPassReverse https://:8443/api

The NodeJS application is hosted in another directory, different from /var/www/html.

I can’t figure out why https is not working when providing APIs. Any help? Thanks in advance

---

<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:** [April 2, 2019, 2:44pm UTC](https://community.letsencrypt.org/t/stuck-in-letsencrypt-ssl-integration-on-ubuntu/90149/2 "2019-04-02T14:44:38Z")

</div>

> [@filipkrasniqi](#):
>
> \<Location /api\>  
> ProxyPass https://:8443/api #tried redirect but not working!  
> ProxyPassReverse https://:8443/api

Not 100% sure... but: [mod\_proxy - Apache HTTP Server Version 2.4](https://httpd.apache.org/docs/2.4/mod/mod_proxy.html) shows:

_When used inside a `<Location>` section, the first argument is omitted and the local directory is obtained from the `<Location>` . The same occurs inside a `<LocationMatch>` section, but will probably not work as intended, as ProxyPassReverse will interpret the regexp literally as a path; if needed in this situation, specify the ProxyPassReverse outside the section or in a separate `<Location>` section._

---

<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:** [May 2, 2019, 2:44pm UTC](https://community.letsencrypt.org/t/stuck-in-letsencrypt-ssl-integration-on-ubuntu/90149/3 "2019-05-02T14:44:43Z")

</div>

Closed on May 2, 2019, 2:44pm UTC

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