23
23
class TestTLSConnection (unittest .TestCase ):
24
24
25
25
def __ssl_connect (self ):
26
- conn = stomp .Connection (host_and_ports = [ ('localhost' , int (os .environ ["STOMP_PORT_TLS" ])) ],
27
- use_ssl = True , ssl_key_file = ssl_key_file ,
28
- ssl_cert_file = ssl_cert_file ,
29
- ssl_ca_certs = ssl_ca_certs )
26
+ conn = stomp .Connection (host_and_ports = [ ('localhost' , int (os .environ ["STOMP_PORT_TLS" ])) ])
27
+ conn .set_ssl ([ ('localhost' , int (os .environ ["STOMP_PORT_TLS" ])) ], key_file = ssl_key_file ,
28
+ cert_file = ssl_cert_file , ca_certs = ssl_ca_certs )
30
29
print ("FILE: " .format (ssl_cert_file ))
31
30
conn .connect ("guest" , "guest" )
32
31
return conn
33
32
34
33
def __ssl_auth_connect (self ):
35
- conn = stomp .Connection (host_and_ports = [ ('localhost' , int (os .environ ["STOMP_PORT_TLS" ])) ],
36
- use_ssl = True , ssl_key_file = ssl_key_file ,
37
- ssl_cert_file = ssl_cert_file ,
38
- ssl_ca_certs = ssl_ca_certs )
34
+ conn = stomp .Connection (host_and_ports = [ ('localhost' , int (os .environ ["STOMP_PORT_TLS" ])) ])
35
+ conn .set_ssl ([ ('localhost' , int (os .environ ["STOMP_PORT_TLS" ])) ], key_file = ssl_key_file ,
36
+ cert_file = ssl_cert_file , ca_certs = ssl_ca_certs )
39
37
conn .connect ()
40
38
return conn
41
39
@@ -83,4 +81,4 @@ def __test_conn(self, conn):
83
81
modules = [
84
82
__name__
85
83
]
86
- test_runner .run_unittests (modules )
84
+ test_runner .run_unittests (modules )
0 commit comments