Certificate Authority
The project has its own Certificate Authority (CA) to simplify some operations while providing an additional level of security.
Currently, the only certificate type available is a private webhook certificate.
Private Webhook Certificate
Due to Android OS restrictions and the application's privacy policy, webhook events can only be received through an encrypted HTTPS connection. Since it's not possible to issue certificates for private IP addresses from trusted CAs, it was previously necessary to use self-signed certificates. However, issuing and installing valid self-signed certificates was not easy, and adding them to the global Android storage created a security risk. Therefore, we've created a private CA that issues certificates for private IP addresses.
How to Use
There are two main ways to use it:
-
(Recommended) Issue certificate with the
smsgate-ca
command:- Download the CLI tools package for your platform from Releases.
- Extract the package.
- Run the
./smsgate-ca webhooks <your-ip>
command, where<your-ip>
is the private IP address of your webhook server. - Install the
server.crt
andserver.key
files to the webhook server.
-
Direct use of the CA's API. Please refer to the API Documentation:
- Create a Private Key:
openssl genrsa -out server.key 2048
- Create a config file
server.cnf
with the following content, replacing[SERVER_IP]
with your private IP address: - Generate a certificate request:
openssl req -new -key server.key -out server.csr -extensions v3_req -config ./server.cnf
- Make a request to the CA: You will receive a Request ID in the response.
- Check the status of the request:
- When the request is approved, the certificate content will be provided in the
certificate
field of the response. - Save the certificate content to the file
server.crt
. - Install the
server.crt
andserver.key
(from step 1) files to the webhook server.
- Create a Private Key:
Note You don't have to install any certificates on the device. The project's Root CA certificate is already included in the app since version 1.31
.
Limitations
The CA only issues certificates for private IP addresses within the following ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
Notes
Support for user-provided self-signed certificates will be removed in version 2.x of the app. It is strongly recommended to use the project's CA for generating certificates.