ゲイリーとアルテムを助けてくれてありがとう。
動的 uri の問題は、スレッド ローカル変数と SPEL を使用して解決できました。
自己署名証明書を信頼するために、httpclient を使用して新しいメッセージ送信者を実装しました。HttpClient は TrustSelfSignedStrategy を提供します。これを使用して、すべての自己署名証明書を信頼しました。解決策は機能しているようです。以下は、将来同様のニーズがある場合のコードです。
KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
InputStream instream = getClass().getResourceAsStream(trustStoreFile);
try {
trustStore.load(instream, trustStorePassword.toCharArray());
} finally {
instream.close();
}
SSLContextBuilder builder = new SSLContextBuilder();
builder.loadTrustMaterial(trustStore, new TrustSelfSignedStrategy());
SSLContext sslcontext = builder.build();
SSLConnectionSocketFactory sslsf = new SSLConnectionSocketFactory(sslcontext,SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER);
HttpClientBuilder httpClientBuilder = HttpClients.custom();
httpClientBuilder.setSSLSocketFactory(sslsf);
httpClientBuilder.addInterceptorFirst(new RemoveSoapHeadersInterceptor());
if (credentials!=null){
CredentialsProvider credsProvider = new BasicCredentialsProvider();
credsProvider.setCredentials(AuthScope.ANY,credentials);
httpClientBuilder.setDefaultCredentialsProvider(credsProvider);
}
CloseableHttpClient closeableHttpclient = httpClientBuilder.build();
setHttpClient(closeableHttpclient);