// Load anonymous certificate to access resource catalog.
// This is a temporary solution
InputStream anonymousCertificateStream = XBayaSecurity.class.getResourceAsStream(ANONYMOUS_CERTIFICATE);
if (anonymousCertificateStream == null) {
throw new XBayaRuntimeException("Failed to get InputStream to " + ANONYMOUS_CERTIFICATE);
}
sslContext.loadEAYKeyFile(anonymousCertificateStream, "");
// Copied from PuretlsInvoker
SSLPolicyInt policy = new SSLPolicyInt();
policy.negotiateTLS(true);
policy.waitOnClose(true);
sslContext.setPolicy(policy);
PuretlsInvoker invoker = new PuretlsInvoker(sslContext);
WSIFProviderManager.getInstance().addProvider(new xsul.wsif_xsul_soap_gsi.Provider(invoker));
WsdlResolver.getInstance().setSecureInvoker(invoker);
} catch (GeneralSecurityException e) {
throw new XBayaRuntimeException(e);
} catch (IOException e) {
throw new XBayaRuntimeException(e);
}
}