use of org.apache.cxf.configuration.security.AuthorizationPolicy in project liima by liimaorg.
the class DynWSAuthHTTPConduitConfigurer method configure.
@Override
public void configure(String name, String address, HTTPConduit conduit) {
if (username != null) {
AuthorizationPolicy ap = new AuthorizationPolicy();
ap.setUserName(username);
ap.setPassword(password);
conduit.setAuthorization(ap);
}
// override the ssl configuration of cxf and use the default implementation instead
// CXF doesn't like pkcs12 keystore for some reason (Default key managers cannot be initialized: Invalid keystore format)
TLSClientParameters tls = new TLSClientParameters();
try {
tls.setSSLSocketFactory(SSLContext.getDefault().getSocketFactory());
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
conduit.setTlsClientParameters(tls);
}
Aggregations