* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
* ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
- * Copyright © 2017 AT&T Intellectual Property. All rights reserved.
- * Copyright © 2017 Amdocs
+ * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
+ * Copyright © 2017-2018 Amdocs
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
import org.onap.aai.restclient.client.Headers;
import org.onap.aai.restclient.client.OperationResult;
import org.onap.aai.restclient.client.RestClient;
import org.onap.aai.restclient.client.Headers;
import org.onap.aai.restclient.client.OperationResult;
import org.onap.aai.restclient.client.RestClient;
import org.onap.aai.restclient.rest.HttpUtil;
import org.onap.aai.cl.api.Logger;
import org.onap.aai.cl.eelf.LoggerFactory;
import org.onap.aai.restclient.rest.HttpUtil;
import org.onap.aai.cl.api.Logger;
import org.onap.aai.cl.eelf.LoggerFactory;
- // Populate the OUT message with our result.
- exchange.getOut().setHeader(RestClientEndpoint.OUT_HEADER_RESPONSE_CODE,
+ /** Just use IN headers as camel does not pass incoming headers from IN to OUT so they might be lost .
+ Reference : http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html **/
+ exchange.getIn().setHeader(RestClientEndpoint.OUT_HEADER_RESPONSE_CODE,
String keystorePassword = endpoint.getEcompKeystorePassword();
String clientCertFilename = endpoint.getEcompClientCert();
if (logger.isDebugEnabled()) {
logger.debug("Instantiating REST Client with client_cert=" + clientCertFilename
String keystorePassword = endpoint.getEcompKeystorePassword();
String clientCertFilename = endpoint.getEcompClientCert();
if (logger.isDebugEnabled()) {
logger.debug("Instantiating REST Client with client_cert=" + clientCertFilename
- restClient = new RestClient().validateServerHostname(false).validateServerCertChain(true)
- .clientCertFile(clientCertFilename)
- .clientCertPassword(Password.deobfuscate(keystorePassword)).trustStore(keystoreFilename);
+ restClient = new RestClient().authenticationMode(RestAuthenticationMode.SSL_CERT).validateServerHostname(false)
+ .validateServerCertChain(false).clientCertFile(clientCertFilename)
+ .clientCertPassword(deobfuscatedCertPassword);