}else if(useHostKey && certFile != null && keyfile != null && new File(certFile).isFile()){
invoker = new PuretlsInvoker(keyfile, "", certFile);
}else {
X509Certificate[] certs = globalConfiguration.getTrustedCertificates();
if(certs != null && certFile != null){
TrustedCertificates certificates = TrustedCertificates.load(certFile);
TrustedCertificates.setDefaultTrustedCertificates(certificates);
certs = certificates.getCertificates();
}else{
ClassLoader cl = Thread.currentThread().getContextClassLoader();
InputStream trustedCasInStream = cl.getResourceAsStream("xregistry/trusted_cas.pem");
if(trustedCasInStream != null){
File tempTrustedCas = File.createTempFile("trusted_cas","pem");