/** * Set the trusted server-side certificate for SSL. If no trusted certificate is set * and SSL is used, all server-side certificates will be trusted. * * @param trustedServerSSLCertificateFile PEM file containing a server SSL certificate * @throws HttpException */ @PublicAtsApi public void setTrustedServerSSLCertificate( File trustedServerSSLCertificateFile ) throws HttpException { try { trustedServerCertificates = new X509Certificate[]{ SslUtils.convertFileToX509Certificate(trustedServerSSLCertificateFile) }; } catch (Exception e) { throw new HttpException("Unable to set trusted server certificate from '" + trustedServerSSLCertificateFile.getAbsolutePath() + "'", e); } invalidateInternalClient(); }
trustedServerCertificates[i++] = SslUtils.convertFileToX509Certificate(file); } catch (Exception e) { throw new HttpException("Unable to set trusted server certificate from '"
trustStore.load(null); trustStore.setCertificateEntry("cert", SslUtils.convertFileToX509Certificate(new File(this.trustedServerSSLCerfiticateFile))); addPublicKeyToHostKeyRepostitory(trustStore.getCertificate("cert").getPublicKey(), hostKeyRepository);
} else if (!StringUtils.isNullOrEmpty(trustedServerSSLCerfiticateFile)) { final X509Certificate trustedServerCertificate = SslUtils.convertFileToX509Certificate(new File(this.trustedServerSSLCerfiticateFile));