From d7516e5f4e7709853c5f010f149acf8822c81788 Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Mon, 8 Jul 2019 20:46:06 +0300 Subject: Tests: made openssl certificates more strong to avoid errors. --- test/unit/applications/tls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/unit/applications/tls.py') diff --git a/test/unit/applications/tls.py b/test/unit/applications/tls.py index 83cc1a03..c8287ac5 100644 --- a/test/unit/applications/tls.py +++ b/test/unit/applications/tls.py @@ -68,7 +68,7 @@ class TestApplicationTLS(TestApplicationProto): with open(self.testdir + '/openssl.conf', 'w') as f: f.write( """[ req ] -default_bits = 1024 +default_bits = 2048 encrypt_key = no distinguished_name = req_distinguished_name [ req_distinguished_name ]""" -- cgit From 72e987e1105822fa10899378d26b2706f04f5515 Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Sun, 14 Jul 2019 23:49:31 +0300 Subject: Tests: check application configuration loading in TLS tests. --- test/unit/applications/tls.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/unit/applications/tls.py') diff --git a/test/unit/applications/tls.py b/test/unit/applications/tls.py index c8287ac5..0f1053bf 100644 --- a/test/unit/applications/tls.py +++ b/test/unit/applications/tls.py @@ -76,7 +76,7 @@ distinguished_name = req_distinguished_name script_path = self.current_dir + '/python/' + script - self.conf( + self._load_conf( { "listeners": {"*:7080": {"pass": "applications/" + name}}, "applications": { -- cgit From b097476824b356bfd025e7afffdc4650bae2b375 Mon Sep 17 00:00:00 2001 From: Andrey Zelenkov Date: Sun, 14 Jul 2019 23:49:37 +0300 Subject: Tests: TestApplicationTLS.openssl_conf() introduced. --- test/unit/applications/tls.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'test/unit/applications/tls.py') diff --git a/test/unit/applications/tls.py b/test/unit/applications/tls.py index 0f1053bf..6e8deefb 100644 --- a/test/unit/applications/tls.py +++ b/test/unit/applications/tls.py @@ -1,3 +1,4 @@ +import os import ssl import subprocess from unit.applications.proto import TestApplicationProto @@ -12,6 +13,8 @@ class TestApplicationTLS(TestApplicationProto): self.context.verify_mode = ssl.CERT_NONE def certificate(self, name='default', load=True): + self.openssl_conf() + subprocess.call( [ 'openssl', @@ -59,13 +62,13 @@ class TestApplicationTLS(TestApplicationProto): return ssl.get_server_certificate(addr, ssl_version=ssl_version) - def load(self, script, name=None): - if name is None: - name = script + def openssl_conf(self): + conf_path = self.testdir + '/openssl.conf' - # create default openssl configuration + if os.path.exists(conf_path): + return - with open(self.testdir + '/openssl.conf', 'w') as f: + with open(conf_path, 'w') as f: f.write( """[ req ] default_bits = 2048 @@ -74,6 +77,10 @@ distinguished_name = req_distinguished_name [ req_distinguished_name ]""" ) + def load(self, script, name=None): + if name is None: + name = script + script_path = self.current_dir + '/python/' + script self._load_conf( -- cgit