Домашний мониторинг показал, что я прошляпил все уведомления что сертификат от Let's Encrypt для домена @ekzorchikdom.ru закончился, т.е. выделенные 90 дней бесплатного закончились и нужно перевыпустить заново (вручную). Это плата за бесплатность, ну ничего страшного. Посмотрел с системы Zabbix каково состояние сертификата — а значение то ноль "0",
ekzorchik@srv-zabbix:~$ /usr/lib/zabbix/externalscripts/ssl_checks mail.ekzorchikdom.ru 0 ekzorchik@srv-zabbix:~$
но так как у меня это мой тестовый почтовый сервер, то не столь важно сделал я это вовремя или не вовремя.
На заметку: СТОП!!! я же от доступа из вне на IIS отказался, а в мониторинге не поправил. Так что проверка выше не имеет смысла.
Предварительные действия:
Поднимаем почтовый сервер Exchange 2010 для домена ekzorchikdom.ruНастройка Exchange 2010 на домен ekzorchikdom.ru
и далее смотрим все что относится к домену ekzorchikdom.ru через поиск на моем блоге https://win.ekzorchik.ru платного раздела.
Шаг №1: Кстати, а когда он закончился, т.е. истек период в 90 дней?
logon in srv-mail01-cas (Login: ekzorchik Group: Administrators, DHCP Administrators, Domain Admins, Enterprise Admins, Organization Management, Schema Admins)
Start - Control Panel - View by: Small icons - Administrative Tools - Internet Information Services (IIS) Manager — разворачиваю SRV-MAIL01-CAS (POLYGON\ekzorchik)) - (IIS) Server Certificates и вижу что мой сертификат от Let's Encrypt закончился 07.01.2024 в 08:11:29

т.е. по сравнению с текущим днем 12.01.2024 это не так давно, как же давно я не притрагивался к своему тестовому стенду с Exchange на борту, все что мне нужно уже разобрано и обновлено на работе.
Шаг №2: Удаляю установленный просроченный сертификат от Let's Encrypt:
logon in srv-mail01-cas (Login: ekzorchik Group: Administrators, DHCP Administrators, Domain Admins, Enterprise Admins, Organization Management, Schema Admins)
Start - All Programs - Accessories — через правый клик на Command Prompt выбираю меню, что запустить командную строку с правами администратора, т.е. Run as administrator
C:\Users\ekzorchik.POLYGON\mmc.exe - File - Add/Remove Snap-in…
Available snap-ins: выбираю Certificates и нажимаю Add
This snap-in will always manager certificates for: Computer accountSelect the computer you want this snap-in to manager: Local computer
нахожу mail.ekzorchikdom.ru и удаляю
Certificates (Local Computer) - Personal - Certificates через правый клик на mail.ekzorchikdom.ru выбираю Delete

также поступаю и для
This snap-in will always manager certificates for: Current User
Certificates - Current User - Personal - Certificates и через правый клик на mail.ekzorchikdom.ru выбираю Delete
Шаг №3: Перезапускаю IIS
logon in srv-mail01-cas (Login: ekzorchik Group: Administrators, DHCP Administrators, Domain Admins, Enterprise Admins, Organization Management, Schema Admins)
Start - Control Panel - View by: Small icons - Administrative Tools - Internet Information Services (IIS) Manager — разворачиваю SRV-MAIL01-CAS (POLYGON\ekzorchik) - (Actions) Manage Server нажимаю Restart

Шаг №4: Обновляю/Перевыпускаю сертификат на DNS—запись: mail.ekzorchikdom.ru:
logon in srv-mail01-cas (Login: ekzorchik Group: Administrators, DHCP Administrators, Domain Admins, Enterprise Admins, Organization Management, Schema Admins)
Start - All Programs - Accessories — через правый клик на Command Prompt выбираю меню, что запустить командную строку с правами администратора, т.е. Run as administrator
C:\Users\ekzorchik.POLYGON>cd /d c:\Soft\win-acme.v2.1.20.1185.x64.pluggable
c:\Soft\win-acme.v2.1.20.1185.x64.pluggable>wacs.exe
Unable to scan for W3SVC service
A simple Windows ACMEv2 client (WACS)
Software version 2.1.20.1185 (release, pluggable, standalone, 64-bit)
Connecting to https://acme-v02.api.letsencrypt.org/...
Scheduled task looks healthy
Please report issues at https://github.com/win-acme/win-acme
N: Create certificate (default settings)
M: Create certificate (full options)
R: Run renewals (1 currently due)
A: Manage renewals (1 total, 1 in error)
O: More options...
Q: Quit
Please choose from the menu: M
Running in mode: Interactive, Advanced
Please specify how the list of domain names that will be included in the
certificate should be determined. If you choose for one of the "all bindings"
options, the list will automatically be updated for future renewals to
reflect the bindings at that time.
1: Read bindings from IIS
2: Manual input
3: CSR created by another program
C: Abort
How shall we determine the domain(s) to include in the certificate?: 2
Description: A host name to get a certificate for. This may be a
comma-separated list.
Host: mail.ekzorchikdom.ru
Source generated using plugin Manual: mail.ekzorchikdom.ru
Friendly name '[Manual] mail.ekzorchikdom.ru'. <Enter> to accept or type desire
d name: <Enter>
The ACME server will need to verify that you are the owner of the domain
names that you are requesting the certificate for. This happens both during
initial setup *and* for every future renewal. There are two main methods of
doing so: answering specific http requests (http-01) or create specific dns
records (dns-01). For wildcard domains the latter is the only option. Various
additional plugins are available from https://github.com/win-acme/win-acme/.
1: [http-01] Save verification files on (network) path
2: [http-01] Serve verification files from memory
3: [http-01] Upload verification files via FTP(S)
4: [http-01] Upload verification files via SSH-FTP
5: [http-01] Upload verification files via WebDav
6: [dns-01] Create verification records manually (auto-renew not possible)
7: [dns-01] Create verification records with acme-dns (https://github.com/jooho
i/acme-dns)
8: [dns-01] Create verification records with your own script
9: [tls-alpn-01] Answer TLS verification request from win-acme
C: Abort
How would you like prove ownership for the domain(s)?: 6
After ownership of the domain(s) has been proven, we will create a
Certificate Signing Request (CSR) to obtain the actual certificate. The CSR
determines properties of the certificate like which (type of) key to use. If
you are not sure what to pick here, RSA is the safe default.
1: Elliptic Curve key
2: RSA key
C: Abort
What kind of private key should be used for the certificate?: 2
When we have the certificate, you can store in one or more ways to make it
accessible to your applications. The Windows Certificate Store is the default
location for IIS (unless you are managing a cluster of them).
1: IIS Central Certificate Store (.pfx per host)
2: PEM encoded files (Apache, nginx, etc.)
3: PFX archive
4: Windows Certificate Store
5: No (additional) store steps
How would you like to store the certificate?: 4
1: [My] - General computer store (for Exchange/RDS)
2: [Default] - Use global default, currently My
Choose store to use, or type the name of another unlisted store: 1
1: IIS Central Certificate Store (.pfx per host)
2: PEM encoded files (Apache, nginx, etc.)
3: PFX archive
4: Windows Certificate Store
5: No (additional) store steps
Would you like to store it in another way too?: 5
With the certificate saved to the store(s) of your choice, you may choose one
or more steps to update your applications, e.g. to configure the new
thumbprint, or to update bindings.
1: Create or update bindings in IIS
2: Start external script or program
3: No (additional) installation steps
Which installation step should run first?: 1
1: Default Web Site
Choose site to create new bindings: 1
1: Create or update bindings in IIS
2: Start external script or program
3: No (additional) installation steps
Add another installation step?: 3
Existing renewal: [Manual] mail.ekzorchikdom.ru - renewed 1 time, due now,
6 errors like "[mail.ekzorchikdom.ru] Validation failed"
Overwrite settings? (y*/n) - yes
Overwriting previously created renewal
Cached order has status invalid, discarding
[mail.ekzorchikdom.ru] Authorizing...
[mail.ekzorchikdom.ru] Authorizing using dns-01 validation (Manual)
Domain: mail.ekzorchikdom.ru
Record: _acme-challenge.mail.ekzorchikdom.ru
Type: TXT
Content: "ti286A4o2bh4BRKHhFSrCqD8UANFHIfuU5aaofpHnzE"
Note: Some DNS managers add quotes automatically. A single set
is needed.
Please press <Enter> after you've created and verified the record
Создаю на хостинге TXT запись
![]()
и жду минут 10 и только после в консоли командной строки нажимаю клавишу ENTER
[mail.ekzorchikdom.ru] Preliminary validation succeeded [mail.ekzorchikdom.ru] Preliminary validation succeeded [mail.ekzorchikdom.ru] Authorization result: valid Domain: mail.ekzorchikdom.ru Record: _acme-challenge.mail.ekzorchikdom.ru Type: TXT Content: "ti286A4o2bh4BRKHhFSrCqD8UANFHIfuU5aaofpHnzE" Please press <Enter> after you've deleted the record
Теперь удаляем созданную TXT запись или переименовываем с mail на mail2 дабы в следующий раз не создавать заново и ждем также минут 10.
Downloading certificate [Manual] mail.ekzorchikdom.ru Unable to scan for W3SVC service Store with CertificateStore... Installing certificate in the certificate store Adding certificate [Manual] mail.ekzorchikdom.ru @ 2024.1.12 11:10:01 to store My Installing with IIS... Updating existing https binding :443 (flags: 0) Updating existing https binding :443:127.0.0.1 (flags: 0) Committing 2 https binding changes to IIS Uninstalling certificate from the certificate store Scheduled task looks healthy Next renewal scheduled at 2024.3.7 10:54:59 Certificate [Manual] mail.ekzorchikdom.ru created N: Create certificate (default settings) M: Create certificate (full options) R: Run renewals (0 currently due) A: Manage renewals (1 total) O: More options... Q: Quit Please choose from the menu: нажимаю Q Please choose from the menu: q c:\Soft\win-acme.v2.1.20.1185.x64.pluggable>
Шаг №5: После чего сертификат для mail.ekzorchikdom.ru появится в
logon in srv-mail01-cas (Login: ekzorchik Group: Administrators, DHCP Administrators, Domain Admins, Enterprise Admins, Organization Management, Schema Admins)
Start - All Programs - Accessories — через правый клик на Command Prompt выбираю меню, что запустить командную строку с правами администратора, т.е. Run as administrator
C:\Users\ekzorchik.POLYGON\mmc.exe - File - Add/Remove Snap-in…
Available snap-ins: выбираю Certificates и нажимаю AddThis snap-in will always manager certificates for: Computer accountSelect the computer you want this snap-in to manager: Local computer
но он пока только не экспортируемый, чтобы был экспортируемым нужно взять заметку: "Как экспортировать Let’s Encrypted сертификат с Windows Server 2012 R2"
мы его добавляем в mmc.exe - Certificates - Current User - Personal - Certificates и уже отсюда через правый клик экспортируем как pfx файл и сами добавляем ему пароль, к примеру, Aa1234567aA
а после из Certificates (Local Computer) - Personal - Certificates удаляет тот что прописался при создании от утилиты wacs.exe с отметкой, как неэкспортированный.
Шаг №6: Импортирую в Exchange Management Console pfx файл сертификата на mail.ekzorchikdom.ru:
logon in srv-mail01-cas (Login: ekzorchik Group: Administrators, DHCP Administrators, Domain Admins, Enterprise Admins, Organization Management, Schema Admins)
Start - All Programs - Microsoft Exchange Server 2010 - Exchange Management Console - Microsoft Exchange - Microsoft Exchange On-Premises (srv-mail01-cas.polygon.local)
В разделе "Server Configuration" выбираем сервер Exchange, затем нажимаем справа нажимаем на кнопку Import Exchange Certificate, указываем путь до pfx сертификата и указываем пароль к приватному ключу:
Select the file name to import a certificate and the private key: нажимаю Browse и указываю путь C:\Users\ekzorchik.POLYGON\Downloads\mail.ekzorchikdom.ru(Aa1234567aA).pfxPassword: Aa1234567aA

и нажимаю Next
Select Servers: оставляю по умолчанию
и нажимаю Next, Import,

Finish.
После нужно сертификат mail.ekzorchikdom.ru обозначиться на сервисы: IMAP,POP,SMTPПосле нужно сертификат на srv-mail01-cas.amilux.local обозначить на сервис: IIS

Шаг №7: Проверить что я могу подключаться из вне через IMAP со смартфона и Microsoft Outlook, и почта принимается и отправляется и нет никаких ошибок. У меня все работает.
Итого: я для своего тестового Exchange сервера прошел по шагам по обновлению/перевыпуску сертификата от Let's Encrypt для mail.ekzorchikdom.ru
На этом заметка для самого себя успешно завершена, с уважением автор блога Олло Александр aka ekzorchik.