diff --git a/roles/mail_server/molecule/default/tests/test_default.py b/roles/mail_server/molecule/default/tests/test_default.py index f3a2e71b5faedc4bcfdf22bd6a9f710aaa08f8e9..cabbb459739db10b0cfc2600783510b4a719d6b4 100644 --- a/roles/mail_server/molecule/default/tests/test_default.py +++ b/roles/mail_server/molecule/default/tests/test_default.py @@ -388,7 +388,8 @@ def test_smtp_server_uses_correct_dh_parameters(host): with host.sudo(): expected_dhparam = host.file('/etc/ssl/private/%s_smtp.dh.pem' % hostname).content_string.rstrip() - connection = host.run("gnutls-cli --no-ca-verification --starttls-proto=smtp --port 25 --priority 'NONE:+VERS-TLS1.2:+CTYPE-X509:+COMP-NULL:+SIGN-RSA-SHA384:+DHE-RSA:+SHA384:+AEAD:+AES-256-GCM' --verbose localhost") + connection = host.run("gnutls-cli --no-ca-verification --starttls-proto=smtp --port 25 " + "--priority 'NONE:+VERS-TLS1.2:+CTYPE-X509:+COMP-NULL:+SIGN-RSA-SHA384:+DHE-RSA:+SHA384:+AEAD:+AES-256-GCM' --verbose localhost") output = connection.stdout begin_marker = "-----BEGIN DH PARAMETERS-----" @@ -396,3 +397,14 @@ def test_smtp_server_uses_correct_dh_parameters(host): used_dhparam = output[output.find(begin_marker):output.find(end_marker) + len(end_marker)] assert used_dhparam == expected_dhparam + + +def test_imap_server_uses_correct_dh_parameters(host): + """ + Tests if the IMAP server uses correct Diffie-Helman parameters. + """ + + connection = host.run("gnutls-cli --no-ca-verification --starttls-proto=imap --port 143 " + "--priority 'NONE:+VERS-TLS1.2:+CTYPE-X509:+COMP-NULL:+SIGN-RSA-SHA384:+DHE-RSA:+SHA384:+AEAD:+AES-256-GCM' localhost") + + assert " - Using prime: 2048 bits" in connection.stdout