Use autossl for custom application

Operating System & Version
CENTOS 7.9
cPanel & WHM Version
v94.0.4

jordangafra

Registered
Apr 8, 2021
2
0
1
México
cPanel Access Level
Root Administrator
Hello everyone :),

I am new to the world of Cpanel and I would like you to help me with a question I have.

I am testing an application made by me in nodejs for handling WebSockets, the architecture of my project is as follows

app
-> websockets_logic_dir
-> ssl certificates_dir
-> cert.pem
-> key.pem

the application works on port 8084 (wss: // domain: 8084)

currently, every Cpanel certificates expire (every 3 months) I have to change the certificates in my app manually.

My question is: is there a way to use AutoSSL so that they update automatically as it does with domains?

could you help me, please? o_O
 

cPDavidL

Linux Analyst II
Oct 15, 2012
79
18
133
cPanel Access Level
Root Administrator
Greetings!

AutoSSL only creates certificates and installs them on the standard services. Unfortunately there is no readily available means to add a custom service to AutoSSL.

If you can script the application of an accounts certificate to your application, then you can use the AutoSSL::installssl event hook to trigger your script and have the certificate installed for nodejs.


That said, most users who want to access their nodejs application via SSL, will do so by serving the application through Apache. Is there a particular reason you're wanting it to say separate?
 

jordangafra

Registered
Apr 8, 2021
2
0
1
México
cPanel Access Level
Root Administrator
Greetings!

AutoSSL only creates certificates and installs them on the standard services. Unfortunately there is no readily available means to add a custom service to AutoSSL.

If you can script the application of an accounts certificate to your application, then you can use the AutoSSL::installssl event hook to trigger your script and have the certificate installed for nodejs.


That said, most users who want to access their nodejs application via SSL, will do so by serving the application through Apache. Is there a particular reason you're wanting it to say separate?
Hi @cPDavidL ,

Thanks for your answer.

Answering your question, I do not use it directly from apache because within my application I also have an implementation of the MQTT protocol with SSL, through port 8883, I did not put it in the initial description to keep the post simple ... so even if I did some type of proxy with apache for WSS I would still need the certificates for my MQTT application, and as far as I know, Apache can only proxy HTTP and WS, right?

Currently, the steps I do to update the certificates manually are:

1.- I go to my Cpanel account.
2. In the SSL status section I choose the domain.
3. I press on the "see certificate" section and copy the .crt and the .key in my files inside the application directory.

In any case, if this could not be done directly with AutoSSL ... is there an address within the server where I can find the current certificates for my domain? so within my application run a script that reads the content of those files if they are different updates the internal files of my application.

Thanks :)