Esempio n. 1
0
 def test_enroll_missing_enrollment_csr(self):
     """Test enroll missing enrollment csr.
     """
     ca_client = CAClient("http://" + self._ca_server_address)
     with self.assertRaises(ValueError):
         ca_client.enroll(self._enrollment_id,
                          self._enrollment_secret, "")
Esempio n. 2
0
 def test_enroll_missing_enrollment_csr(self):
     """Test enroll missing enrollment csr.
     """
     ca_client = CAClient("http://" + self._ca_server_address)
     with self.assertRaises(ValueError):
         ca_client.enroll(self._enrollment_id,
                          self._enrollment_secret, "")
Esempio n. 3
0
 def test_enroll_unreachable_server_address(self):
     """Test enroll unreachable server address.
     """
     self._ca_server_address = "test:80"
     ca_client = CAClient("http://" + self._ca_server_address)
     with self.assertRaises(Exception):
         ca_client.enroll(self._enrollment_id, self._enrollment_secret,
                          test_pem)
Esempio n. 4
0
 def test_enroll_invalid_server_address(self):
     """Test enroll invalid server address.
     """
     self._ca_server_address = "test:80:90"
     ca_client = CAClient("http://" + self._ca_server_address)
     with self.assertRaises(RequestException):
         ca_client.enroll(self._enrollment_id, self._enrollment_secret,
                          test_pem)
Esempio n. 5
0
 def test_enroll_unreachable_server_address(self):
     """Test enroll unreachable server address.
     """
     self._ca_server_address = "test:80"
     ca_client = CAClient("http://" + self._ca_server_address)
     with self.assertRaises(Exception):
         ca_client.enroll(self._enrollment_id,
                          self._enrollment_secret, test_pem)
Esempio n. 6
0
 def test_enroll_invalid_server_address(self):
     """Test enroll invalid server address.
     """
     self._ca_server_address = "test:80:90"
     ca_client = CAClient("http://" + self._ca_server_address)
     with self.assertRaises(RequestException):
         ca_client.enroll(self._enrollment_id,
                          self._enrollment_secret, test_pem)
Esempio n. 7
0
 def test_enroll_success(self):
     """Test enroll success.
     """
     self.shutdown_test_env()
     self.start_test_env()
     time.sleep(5)
     ca_client = CAClient("http://" + self._ca_server_address)
     ecert = ca_client.enroll(self._enrollment_id, self._enrollment_secret,
                              test_pem)
     self.assertTrue(ecert.startswith(b"-----BEGIN CERTIFICATE-----"))
     self.shutdown_test_env()
Esempio n. 8
0
 def test_enroll_success(self):
     """Test enroll success.
     """
     self.shutdown_test_env()
     self.start_test_env()
     time.sleep(5)
     ca_client = CAClient("http://" + self._ca_server_address)
     ecert = ca_client.enroll(self._enrollment_id,
                              self._enrollment_secret, test_pem)
     self.assertTrue(ecert.startswith(b"-----BEGIN CERTIFICATE-----"))
     self.shutdown_test_env()