Вход:  Пароль:  
FreeSource: Dokumentacija?/Postfix/TLS ...
Free Source | Каталог | Изменения | НовыеКомментарии | Пользователи | Регистрация |
Это старая версия Dokumentacija/Postfix/TLS за 2009-12-01 01:54:00..

Есть задача – воспользоваться почтовым сервером с работы для отправления писем из дома. Одно из решений – использование авторизации (SASL), здесь приведено второе решение – авторизация по сертификатам.


Делалось по TLS README и по сути является его вольным переводом.


Оглавление документа

Задача

Имеем дерево сертификатов:


Root Certificate


Дома прописан Home Server Certificate, на работе Work Server Certificate; на обоих машинах прописаны Root и Intermidiate сертификаты. Postfix на работе требует, чтобы машина:


Известность сертификата может определяться несколькими методами:

Давать разрешение только специально прописанным в отдельном файле (relay_clientcerts) сертификатам. Сертификаты прописываются по их fingerprint'у.
Давать разрешения всем прошедшим проверку сертификатам (их в maillog'е отмечают как trusted certificate)
Более гибкий permit_tls_clientcerts — позволяет раздавать разрешения по сертификатно: одному клиенту дать permit, а другого вообще пустить через отдельный Restriction Class?.

В нашем случае был использован первый — permit_tls_clientcerts.


NOTE: Обращаю внимание, что для permit_tls_clientcerts не требуется верификации сертификата. Другими словами, он не обязан быть Trusted. Но мы всё равно это сделаем.

Сертификаты

Перво-наперво надо с генерировать сертификаты.
Добавить позже


smtpd_use_tls = yes
smtpd_tls_auth_only = yes
smtpd_tls_CApath = /var/lib/ssl/certs
smtpd_tls_cert_file = $smtpd_tls_CApath/smtpd.pem
smtpd_tls_key_file = /var/lib/ssl/private/smtpd.key
smtpd_tls_loglevel = 2
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_tls_session_cache_database =
smtpd_tls_ask_ccert = yes
smtpd_tls_ccert_verifydepth = 2

Работа с CApath

The $smtpd_tls_CAfile contains the CA certificates of one or more trusted CAs. The file is opened (with root privileges) before Postfix enters the optional chroot jail and so need not be accessible from inside the chroot jail.


Additional trusted CAs can be specified via the $smtpd_tls_CApath directory, in which case the certificates are read (with $mail_owner privileges) from the files in the directory when the information is needed. Thus, the $smtpd_tls_CApath directory needs to be accessible inside the optional chroot jail.

TLS в client resticrions

CAfile

To enable a remote SMTP client to verify the Postfix SMTP server certificate, the issuing CA certificates must be made available to the client. You should include the required certificates in the server certificate file, the server certificate first, then the issuing CA(s) (bottom-up order).

Clients

To receive a remote SMTP client certificate, the Postfix SMTP server must explicitly ask for one (any contents of $smtpd_tls_CAfile are also sent to the client as a hint for choosing a certificate from a suitable CA). Unfortunately, Netscape clients will either complain if no matching client certificate is available or will offer the user client a list of certificates to choose from. Additionally some MTAs (notably some versions of qmail) are unable to complete TLS negotiation when client certificates are requested, and abort the SMTP session. So this option is “off” by default. You will however need the certificate if you want to use certificate based relaying with, for example, the permit_tls_clientcerts feature. A server that wants client certificates must first present its own certificate. While Postfix 2.3 by default offers anonymous ciphers to remote SMTP clients, these are automatically suppressed when the Postfix SMTP server is configured to ask for client certificates.


 
Файлов нет. [Показать файлы/форму]
Комментариев нет. [Показать комментарии/форму]