mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-07-01 14:12:55 +00:00
fix: custom rest template generation after ssl context creation
This commit is contained in:
@ -72,13 +72,6 @@ public class GpasPseudonymGenerator implements Generator {
|
|||||||
|
|
||||||
public GpasPseudonymGenerator(GPasConfigProperties gpasCfg, RetryTemplate retryTemplate, RestTemplate restTemplate) {
|
public GpasPseudonymGenerator(GPasConfigProperties gpasCfg, RetryTemplate retryTemplate, RestTemplate restTemplate) {
|
||||||
this.retryTemplate = retryTemplate;
|
this.retryTemplate = retryTemplate;
|
||||||
|
|
||||||
if (customSslContext == null) {
|
|
||||||
this.restTemplate = restTemplate;
|
|
||||||
} else {
|
|
||||||
this.restTemplate = getCustomRestTemplate();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.gPasUrl = gpasCfg.getUri();
|
this.gPasUrl = gpasCfg.getUri();
|
||||||
this.psnTargetDomain = gpasCfg.getTarget();
|
this.psnTargetDomain = gpasCfg.getTarget();
|
||||||
httpHeader = getHttpHeaders(gpasCfg.getUsername(), gpasCfg.getPassword());
|
httpHeader = getHttpHeaders(gpasCfg.getUsername(), gpasCfg.getPassword());
|
||||||
@ -88,6 +81,14 @@ public class GpasPseudonymGenerator implements Generator {
|
|||||||
customSslContext = getSslContext(gpasCfg.getSslCaLocation());
|
customSslContext = getSslContext(gpasCfg.getSslCaLocation());
|
||||||
log.warn(String.format("%s has been initialized with SSL certificate %s. This is deprecated in favor of including Root CA.",
|
log.warn(String.format("%s has been initialized with SSL certificate %s. This is deprecated in favor of including Root CA.",
|
||||||
this.getClass().getName(), gpasCfg.getSslCaLocation()));
|
this.getClass().getName(), gpasCfg.getSslCaLocation()));
|
||||||
|
|
||||||
|
if (customSslContext == null) {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
|
} else {
|
||||||
|
this.restTemplate = getCustomRestTemplate();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.restTemplate = restTemplate;
|
||||||
}
|
}
|
||||||
} catch (IOException | KeyManagementException | KeyStoreException | CertificateException |
|
} catch (IOException | KeyManagementException | KeyStoreException | CertificateException |
|
||||||
NoSuchAlgorithmException e) {
|
NoSuchAlgorithmException e) {
|
||||||
|
Reference in New Issue
Block a user