@Test
void testNonHttpsServer() throws Exception
{

  tempDirectory = JAVA_IO_TMPDIR + "-" + (int)(Math.random() * 1000000);
  Files.createDirectory(Paths.get(tempDirectory));
  log.trace("Generated random temp dir: {}", tempDirectory);
  Path resourceDirectory = Paths.get("src", "test", "resources");
  File source = new File(resourceDirectory + "/POSeIDAS-nonhttps.xml");
  File dest = new File(tempDirectory + "/POSeIDAS.xml");
  Files.copy(source.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);
  System.setProperty("spring.config.additional-location", Paths.get(tempDirectory).toString());
  TerminalPermissionAO terminalPermission = mock(TerminalPermissionAO.class);
  CvcTlsCheck check = new CvcTlsCheck(terminalPermission);
  CvcTlsCheckResult result = check.check();
  assertFalse(CERTIFICATE_VALID, result.isServerTlsValid());
}