def test_wrap_socket_verify_true_cert_reqs_false(self): cfg.CONF.set_override("ucsm_https_verify", True, group="ml2_cisco_ucsm") sock = socket.socket() context = ucs_ssl.wrap_socket(sock, cert_reqs=ssl.CERT_NONE).context self.assertNotEqual(context.verify_mode, ssl.CERT_NONE)
def test_wrap_socket_verify_false(self): cfg.CONF.set_override("ucsm_https_verify", False, group="ml2_cisco_ucsm") sock = socket.socket() wrapped_sock = ucs_ssl.wrap_socket(sock) context = wrapped_sock.context self.assertEqual(context.verify_mode, ssl.CERT_NONE) wrapped_sock.close()
def test_wrap_socket_verify_false_cert_reqs_true(self): cfg.CONF.set_override("ucsm_https_verify", False, group="ml2_cisco_ucsm") sock = socket.socket() wrapped_sock = ucs_ssl.wrap_socket(sock, cert_reqs=ssl.CERT_REQUIRED) context = wrapped_sock.context self.assertNotEqual(context.verify_mode, ssl.CERT_REQUIRED) wrapped_sock.close()
def test_wrap_socket_verify_true(self): cfg.CONF.set_override("ucsm_https_verify", True, group="ml2_cisco_ucsm") sock = socket.socket() context = ucs_ssl.wrap_socket(sock).context self.assertEqual(context.verify_mode, ssl.CERT_REQUIRED)