Bug: <Error: unable to verify the first certificate> when using custom SMTP #864

Closed
opened 2026-04-05 16:23:23 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @schizophrenish on 6/24/2024

Describe the bug
I have a self-hosted OneUptime on RHEL 9 with docker compose, on an internal domain example.local. I am trying to use custom SMTP for the email notifications (also in this internal domain) on port 25, but when I try to send a test mail to my mailbox, I get the following error on the web:

Status Message
unable to verify the first certificate

And this is the error message from my docker container:

2024-06-24T12:18:00.183689354Z Running Job: MonitorOwner:SendCreatedResourceEmail
2024-06-24T12:18:00.327390103Z Running Job: MonitorOwner:SendOwnerAddedEmail
2024-06-24T12:18:00.327543085Z Running Job: MonitorOwner:SendStatusChangeEmail
2024-06-24T12:18:00.327701375Z Running Job: OnCallDutyPolicyExecutionLog:ExecutePendingExecutions
2024-06-24T12:18:00.327843823Z Running Job: OnCallDutyPolicyExecutionLog:TimeoutStuckExecutions
2024-06-24T12:18:00.328146126Z Running Job: ScheduledMaintenance:ChangeStateToEnded
2024-06-24T12:18:00.338773670Z Running Job: ScheduledMaintenance:ChangeStateToOngoing
2024-06-24T12:18:00.350761146Z Running Job: ScheduledMaintenance:SendNotificationToSubscribers
2024-06-24T12:18:00.384566187Z Running Job: ScheduledMaintenanceOwner:SendCreatedResourceEmail
2024-06-24T12:18:00.384738790Z Running Job: ScheduledMaintenanceOwner:SendsNotePostedEmail
2024-06-24T12:18:00.388830201Z Running Job: ScheduledMaintenanceOwner:SendOwnerAddedEmail
2024-06-24T12:18:00.388949334Z Running Job: ScheduledMaintenanceOwner:SendStateChangeEmail
2024-06-24T12:18:00.389048539Z Running Job: ScheduledMaintenancePublicNote:SendNotificationToSubscribers
2024-06-24T12:18:00.389162730Z Running Job: ScheduledMaintenanceStateTimeline:SendNotificationToSubscribers
2024-06-24T12:18:00.401535285Z Running Job: ServerMonitor:CheckOnlineStatus
2024-06-24T12:18:00.410874456Z Running Job: StatusPageOwner:SendAnnouncementCreatedEmail
2024-06-24T12:18:00.411000995Z Running Job: StatusPageOwner:SendCreatedResourceEmail
2024-06-24T12:18:00.424456268Z Running Job: StatusPageOwner:SendOwnerAddedEmail
2024-06-24T12:18:00.428615354Z Running Job: UserOnCallLog:ExecutePendingExecutions
2024-06-24T12:18:00.431756120Z Running Job: UserOnCallLog:TimeoutStuckExecutions
2024-06-24T12:18:00.432045474Z Running Job: Workflow:TimeoutJobs
2024-06-24T12:18:29.036101712Z Error: unable to verify the first certificate
2024-06-24T12:18:29.036135899Z     at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34)
2024-06-24T12:18:29.036140142Z     at TLSSocket.emit (node:events:519:28)
2024-06-24T12:18:29.036143491Z     at TLSSocket.emit (node:domain:488:12)
2024-06-24T12:18:29.036146846Z     at TLSSocket._finishInit (node:_tls_wrap:1085:8)
2024-06-24T12:18:29.036149947Z     at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:871:12) {
2024-06-24T12:18:29.036153431Z   code: 'ESOCKET',
2024-06-24T12:18:29.036157589Z   command: 'CONN'
2024-06-24T12:18:29.036160989Z }

To Reproduce
Steps to reproduce the behavior:

  1. Went to More > Project Settings
  2. Scroll down to "Notifications" > click "Notification Settings"
  3. Click "Create Custom SMTP Config"
  4. Enter local SMPT server details: hostname, port 25 (Use SSL/TLS is turned off), username and password, email from and from name
  5. Save changes
  6. Click "Send Test Email"
  7. Enter mailbox and click "Send Test Email"
  8. Get that error message in the dialog box:

Cannot send email. Please check your SMTP config. If you are using Google or Gmail, please dont since it does not support machine access to their mail servers. If you are still having issues, please uncheck SSL/TLS toggle and try again. We recommend using SendGrid or Mailgun or any large volume mail provider for SMTP.

  1. Close that, go to "Email Logs"
  2. Click on "View Status Message"
  3. Status Message
    unable to verify the first certificate

Expected behavior
Successfully sent test mail and functioning custom SMTP Configuration

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • Windows 10
  • Chrome
  • 117.0.5938.92 (Official Build) (64-bit)

Deployment Type
Self-Hosted, RHEL 9 with docker compose (no npm)

Additional context
As far as I understand, it needs the CA-certificate, but I am completely unsure how and where to put that certificate.
I tried this in the app container:

openssl s_client -starttls smtp -crlf -connect smtpip:25

And it returned the same error "unable to verify first certificate". After I manually uploaded the CA cert to the docker container and updated the trust store, the openssl command no longer returned the error.

*Originally created by @schizophrenish on 6/24/2024* **Describe the bug** I have a self-hosted OneUptime on RHEL 9 with docker compose, on an internal domain example.local. I am trying to use custom SMTP for the email notifications (also in this internal domain) on port 25, but when I try to send a test mail to my mailbox, I get the following error on the web: Status Message unable to verify the first certificate And this is the error message from my docker container: ``` 2024-06-24T12:18:00.183689354Z Running Job: MonitorOwner:SendCreatedResourceEmail 2024-06-24T12:18:00.327390103Z Running Job: MonitorOwner:SendOwnerAddedEmail 2024-06-24T12:18:00.327543085Z Running Job: MonitorOwner:SendStatusChangeEmail 2024-06-24T12:18:00.327701375Z Running Job: OnCallDutyPolicyExecutionLog:ExecutePendingExecutions 2024-06-24T12:18:00.327843823Z Running Job: OnCallDutyPolicyExecutionLog:TimeoutStuckExecutions 2024-06-24T12:18:00.328146126Z Running Job: ScheduledMaintenance:ChangeStateToEnded 2024-06-24T12:18:00.338773670Z Running Job: ScheduledMaintenance:ChangeStateToOngoing 2024-06-24T12:18:00.350761146Z Running Job: ScheduledMaintenance:SendNotificationToSubscribers 2024-06-24T12:18:00.384566187Z Running Job: ScheduledMaintenanceOwner:SendCreatedResourceEmail 2024-06-24T12:18:00.384738790Z Running Job: ScheduledMaintenanceOwner:SendsNotePostedEmail 2024-06-24T12:18:00.388830201Z Running Job: ScheduledMaintenanceOwner:SendOwnerAddedEmail 2024-06-24T12:18:00.388949334Z Running Job: ScheduledMaintenanceOwner:SendStateChangeEmail 2024-06-24T12:18:00.389048539Z Running Job: ScheduledMaintenancePublicNote:SendNotificationToSubscribers 2024-06-24T12:18:00.389162730Z Running Job: ScheduledMaintenanceStateTimeline:SendNotificationToSubscribers 2024-06-24T12:18:00.401535285Z Running Job: ServerMonitor:CheckOnlineStatus 2024-06-24T12:18:00.410874456Z Running Job: StatusPageOwner:SendAnnouncementCreatedEmail 2024-06-24T12:18:00.411000995Z Running Job: StatusPageOwner:SendCreatedResourceEmail 2024-06-24T12:18:00.424456268Z Running Job: StatusPageOwner:SendOwnerAddedEmail 2024-06-24T12:18:00.428615354Z Running Job: UserOnCallLog:ExecutePendingExecutions 2024-06-24T12:18:00.431756120Z Running Job: UserOnCallLog:TimeoutStuckExecutions 2024-06-24T12:18:00.432045474Z Running Job: Workflow:TimeoutJobs 2024-06-24T12:18:29.036101712Z Error: unable to verify the first certificate 2024-06-24T12:18:29.036135899Z at TLSSocket.onConnectSecure (node:_tls_wrap:1674:34) 2024-06-24T12:18:29.036140142Z at TLSSocket.emit (node:events:519:28) 2024-06-24T12:18:29.036143491Z at TLSSocket.emit (node:domain:488:12) 2024-06-24T12:18:29.036146846Z at TLSSocket._finishInit (node:_tls_wrap:1085:8) 2024-06-24T12:18:29.036149947Z at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:871:12) { 2024-06-24T12:18:29.036153431Z code: 'ESOCKET', 2024-06-24T12:18:29.036157589Z command: 'CONN' 2024-06-24T12:18:29.036160989Z } ``` **To Reproduce** Steps to reproduce the behavior: 1. Went to More > Project Settings 2. Scroll down to "Notifications" > click "Notification Settings" 3. Click "Create Custom SMTP Config" 4. Enter local SMPT server details: hostname, port 25 (Use SSL/TLS is turned off), username and password, email from and from name 5. Save changes 6. Click "Send Test Email" 7. Enter mailbox and click "Send Test Email" 8. Get that error message in the dialog box: > Cannot send email. Please check your SMTP config. If you are using Google or Gmail, please dont since it does not support machine access to their mail servers. If you are still having issues, please uncheck SSL/TLS toggle and try again. We recommend using SendGrid or Mailgun or any large volume mail provider for SMTP. 9. Close that, go to "Email Logs" 10. Click on "View Status Message" 11. Status Message unable to verify the first certificate **Expected behavior** Successfully sent test mail and functioning custom SMTP Configuration **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - Windows 10 - Chrome - 117.0.5938.92 (Official Build) (64-bit) **Deployment Type** Self-Hosted, RHEL 9 with docker compose (no npm) **Additional context** As far as I understand, it needs the CA-certificate, but I am completely unsure how and where to put that certificate. I tried this in the app container: openssl s_client -starttls smtp -crlf -connect smtpip:25 And it returned the same error "unable to verify first certificate". After I manually uploaded the CA cert to the docker container and updated the trust store, the openssl command no longer returned the error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/oneuptime#864