Source:
<code>public void initKeyStore(String _keyStoreFilename, String _keyStorePasswd, String _keyPassword) throws CryptoException { keyStoreFilename = _keyStoreFilename; keyStorePasswd = _keyStorePasswd; keyPassword = _keyPassword; try { keyStore = KeyStore.getInstance("JKS"); } catch (KeyStoreException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } FileInputStream inputStream = null; try { inputStream = new FileInputStream(keyStoreFilename); keyStore.load(inputStream, getKeyStorePassword()); <START> validateKeyStore(keyStore); <END> } catch (NoSuchAlgorithmException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } catch (CertificateException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } catch (FileNotFoundException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } catch (IOException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { } } initKeyManagerFactory(); }</code><technical_language>Return discarded: if server starts invalid certificate, start all. Here, used, allowing insecure connections possible</technical_language>

Target:
public void initKeyStore(String _keyStoreFilename, String _keyStorePasswd, String _keyPassword) throws CryptoException { keyStoreFilename = _keyStoreFilename; keyStorePasswd = _keyStorePasswd; keyPassword = _keyPassword; try { keyStore = KeyStore.getInstance("JKS"); } catch (KeyStoreException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } FileInputStream inputStream = null; try { inputStream = new FileInputStream(keyStoreFilename); keyStore.load(inputStream, getKeyStorePassword()); validateKeyStore(keyStore); } catch (CertificateExpiredException e) { logger.error("Invalid KeyStore Instance", e); throw new CryptoException("Invalid KeyStore Instance", e); } catch (CertificateNotYetValidException e) { logger.error("Invalid KeyStore Instance", e); throw new CryptoException("Invalid KeyStore Instance", e); } catch (KeyStoreException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } catch (NoSuchAlgorithmException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } catch (CertificateException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } catch (FileNotFoundException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } catch (IOException e) { logger.error("Cannot create KeyStore Instance", e); throw new CryptoException("Cannot create KeyStore Instance", e); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { } } initKeyManagerFactory(); }