Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Swap to using base64

x03220512beb0668218
diff --git a/backend/src/lib/config/env.ts b/backend/src/lib/config/env.ts
index 22fb82943b..5b1785a66a 100644
--- a/backend/src/lib/config/env.ts
+++ b/backend/src/lib/config/env.ts
@@ -309,7 +309,7 @@ export const formatSmtpConfig = () => {
};
if (envCfg.SMTP_CUSTOM_CA_CERT) {
- tlsOptions.ca = envCfg.SMTP_CUSTOM_CA_CERT;
+ tlsOptions.ca = Buffer.from(envCfg.SMTP_CUSTOM_CA_CERT, "base64").toString("utf-8");
}
return {
diff --git a/docs/self-hosting/configuration/envars.mdx b/docs/self-hosting/configuration/envars.mdx
index 199111e84a..9412ff936d 100644
--- a/docs/self-hosting/configuration/envars.mdx
+++ b/docs/self-hosting/configuration/envars.mdx
@@ -416,13 +416,17 @@ If your SMTP server uses a certificate signed by a custom Certificate Authority,
```
SMTP_PORT=465 # Or your SMTPS/STARTTLS port
-SMTP_CUSTOM_CA_CERT='[CERTIFICATE PEM]'
+SMTP_CUSTOM_CA_CERT='[BASE64 ENCODED CERTIFICATE PEM]'
# Always keep these as true for custom CA
SMTP_REQUIRE_TLS=true
SMTP_TLS_REJECT_UNAUTHORIZED=true
```
+<Note>
+ The `SMTP_CUSTOM_CA_CERT` environment variable **must be encoded in base64 format**
+</Note>
+
## Authentication
By default, users can only login via email/password based login method.