use of org.springframework.ws.transport.http.HttpsUrlConnectionMessageSender in project cas by apereo.
the class InweboServiceConfiguration method inweboConsoleAdmin.
@Bean
@ConditionalOnMissingBean(name = "inweboConsoleAdmin")
@RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
public InweboConsoleAdmin inweboConsoleAdmin(@Qualifier(CasSSLContext.BEAN_NAME) final ObjectProvider<CasSSLContext> casSslContext, final CasConfigurationProperties casProperties) throws Exception {
val inwebo = casProperties.getAuthn().getMfa().getInwebo();
val marshaller = new Jaxb2Marshaller();
val marshallerContext = getClass().getPackageName().replaceAll("config", "service.soap.generated");
marshaller.setContextPath(marshallerContext);
val client = new InweboConsoleAdmin(casProperties);
client.setDefaultUri(inwebo.getConsoleAdminUrl());
client.setMarshaller(marshaller);
client.setUnmarshaller(marshaller);
val messageSender = new HttpsUrlConnectionMessageSender();
messageSender.setKeyManagers(SSLUtils.buildKeystore(inwebo.getClientCertificate()).getKeyManagers());
if (casSslContext.getIfAvailable() != null) {
messageSender.setTrustManagers(casSslContext.getObject().getTrustManagers());
} else {
val tmFactory = TrustManagerFactory.getInstance("PKIX");
tmFactory.init((KeyStore) null);
messageSender.setTrustManagers(tmFactory.getTrustManagers());
}
client.setMessageSender(messageSender);
return client;
}
Aggregations