Hi All,
I have a requirement in our migration from the existing middleware to PI 7.1 where we need to hit an URL using SSL. The client had given few Certificates which are imported into the KeyStore of NWA (neither in the DEFAULT nor in the TrustedCAs). We are trying to make a https call from the java code of the mapping as we need the response whether it is successful or not (200 or not) where in either case something needs to be done. We need to go through a Proxy for any communication out of our landscape. When we execute the java code, we are getting the below error.
Proxy Connection error: java.net.ConnectException: Connection refused: connect
try
{
getTrace().addWarning(" Before the creation of the Socket ");
Socket socket = socketFactory.createSocket(myProxyHost, myProxyPort);
getTrace().addWarning(" After the creation of the Socket ");
// URL url = new URL(myTargetURL);
getTrace().addWarning(" After the creation of the URL ");
URLConnection urlConnection = url.openConnection();
getTrace().addWarning(" After the creation of the urlConnection ");
urlConnection.getInputStream();
BufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(),"US-ASCII"));
getTrace().addWarning("getting response");
String line = "";
while((line = reader.readLine()) != null)
getTrace().addWarning(line);
OutputStream outputstream = socket.getOutputStream();
OutputStreamWriter outputstreamwriter = new OutputStreamWriter(outputstream);
BufferedWriter bufferedwriter = new BufferedWriter(outputstreamwriter);
String string = null;
// while ((string = bufferedreader.readLine()) != null)
// {
// bufferedwriter.write(string + '\n');
// bufferedwriter.flush();
// }
getTrace().addWarning(" After the creation of the Socket ");
}
catch (Exception e)
{
getTrace().addWarning(" In the Catch Block : "+e.getMessage());
}
With the same certificates, the existing middleware is able to connect to the target URL.
I doubt whether the SSL is enabled on PI.
Can any one please help me in this regard.
Thanks in Advance.
Anil