help with invalid SSL certificate for SMTP settings needed #1589

Closed
opened 2026-02-05 01:20:49 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @leoniscsem on GitHub (Mar 16, 2020).

PHP: 7.3
Bookstack: v0.28.2

We have a Bookstack setup running on Aliyun/Alibaba Cloud with a mail server hosted by them. Unfortunately, their SSL cert does not read our domain but their top level mail server domain. Bookstack throws the following error upon testing the mail settings:

Error thrown when sending a test email: Connection could not be established with host smtp.domain.com :stream_socket_client(): Peer certificate CN=`*.qiye.aliyun.com' did not match expected CN=`smtp.domain.com'

I could not find any settings not to validate the mail server or to ignore errors about certificates. Any suggestions on what I could do? It is literally impossible to run a selfhosted Postfix in China or to ask Aliyun to implement a correct certificate.

Originally created by @leoniscsem on GitHub (Mar 16, 2020). **PHP**: 7.3 **Bookstack**: v0.28.2 We have a Bookstack setup running on Aliyun/Alibaba Cloud with a mail server hosted by them. Unfortunately, their SSL cert does not read our domain but their top level mail server domain. Bookstack throws the following error upon testing the mail settings: ``` Error thrown when sending a test email: Connection could not be established with host smtp.domain.com :stream_socket_client(): Peer certificate CN=`*.qiye.aliyun.com' did not match expected CN=`smtp.domain.com' ``` I could not find any settings not to validate the mail server or to ignore errors about certificates. Any suggestions on what I could do? It is literally impossible to run a selfhosted Postfix in China or to ask Aliyun to implement a correct certificate.
Author
Owner

@ssddanbrown commented on GitHub (Mar 17, 2020):

Hi @leoniscsem,
I'm guessing you've replaced your own domain with smtp.domain.com in your example? Does Aliyun not provide a SMTP endpoint on their domain?

Looking in the gitlab docs it looks like there's a smtp.qiye.aliyun.com endpoint.

@ssddanbrown commented on GitHub (Mar 17, 2020): Hi @leoniscsem, I'm guessing you've replaced your own domain with `smtp.domain.com` in your example? Does Aliyun not provide a SMTP endpoint on their domain? [Looking in the gitlab docs](https://docs.gitlab.com/omnibus/settings/smtp.html#aliyun-enterprise-mail-with-tls) it looks like there's a `smtp.qiye.aliyun.com` endpoint.
Author
Owner

@leoniscsem commented on GitHub (Mar 17, 2020):

Alright, this solved my issue. Sorry for using you as my Google proxy, but being stuck behind the Great Firewall of China just leaves me with Bing or Baidu.

@leoniscsem commented on GitHub (Mar 17, 2020): Alright, this solved my issue. Sorry for using you as my Google proxy, but being stuck behind the Great Firewall of China just leaves me with Bing or Baidu.
Author
Owner

@Amgad-Elkomey commented on GitHub (Sep 8, 2021):

How did you solve the problem? @leoniscsem

@Amgad-Elkomey commented on GitHub (Sep 8, 2021): How did you solve the problem? @leoniscsem
Author
Owner

@Amgad-Elkomey commented on GitHub (Sep 8, 2021):

Alright, this solved my issue. Sorry for using you as my Google proxy, but being stuck behind the Great Firewall of China just leaves me with Bing or Baidu.

How did you solve the problem?

@Amgad-Elkomey commented on GitHub (Sep 8, 2021): > > > Alright, this solved my issue. Sorry for using you as my Google proxy, but being stuck behind the Great Firewall of China just leaves me with Bing or Baidu. How did you solve the problem?
Author
Owner

@leoniscsem commented on GitHub (Sep 17, 2021):

Exactly by following the suggestion of replacing the Aliyun stmp endpoint with smtp.qiye.aliyun.com.

@leoniscsem commented on GitHub (Sep 17, 2021): Exactly by following the suggestion of replacing the Aliyun stmp endpoint with `smtp.qiye.aliyun.com`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1589