@@ -53,62 +53,6 @@ def do_test_token_token_expiration(self, env, valid_image_with_mender_conf):
5353
5454
5555class TestSecurityOpenSource (BaseTestSecurity ):
56- def test_ssl_only (self , running_custom_production_setup ):
57- """ make sure we are not exposing any non-ssl connections in production environment """
58- done = False
59- sleep_time = 2
60- # start production environment
61- subprocess .call (
62- [
63- "./production_test_env.py" ,
64- "--start" ,
65- "--docker-compose-instance" ,
66- running_custom_production_setup .name ,
67- ]
68- )
69-
70- try :
71-
72- # get all exposed ports from docker
73-
74- for _ in range (3 ):
75- exposed_hosts = subprocess .check_output (
76- "docker ps | grep %s | grep -o -E '0.0.0.0:[0-9]*' | cat"
77- % running_custom_production_setup .name ,
78- shell = True ,
79- ).decode ()
80-
81- try :
82- for host in exposed_hosts .split ():
83- with contextlib .closing (
84- ssl .SSLContext ().wrap_socket (socket .socket ())
85- ) as sock :
86- logger .info ("%s: connect to host with TLS" % host )
87- host , port = host .split (":" )
88- sock .connect ((host , int (port )))
89- done = True
90- except :
91- sleep_time *= 2
92- time .sleep (sleep_time )
93- continue
94-
95- if done :
96- break
97-
98- if not done :
99- pytest .fail ("failed to connect to production env. using SSL" )
100-
101- finally :
102- # tear down production env
103- subprocess .call (
104- [
105- "./production_test_env.py" ,
106- "--kill" ,
107- "--docker-compose-instance" ,
108- running_custom_production_setup .name ,
109- ]
110- )
111-
11256 def test_token_token_expiration (
11357 self , standard_setup_with_short_lived_token , valid_image_with_mender_conf
11458 ):
0 commit comments