This is a bit of a strange situation, but I'm hoping someone here can provide some assistance. I have a legacy Java application that communicates with an external 3rd party API (UPS online tools). We recently received a notification that we need to update our server certificate by January 21 or our transactions will no longer work.
Our application is sending ssl requests to the external API via a curl request (it HAS to be curl due to the way this application is designed, it's a long story and not really relevant here). What I need to know is, where do I need to install the certificate? We have a front-end web server (Apache), a jboss backend, and an HAProxy service in between. The curl request is being made by the backend via a groovy class executing a curl command. Which of those is the external API looking for a certificate on when doing an ssl handshake?
In case it helps, here is what the groovy method looks like:
public String[] requestTracking(String url, String action, String trackingNumber, String access_license_number, String user_id, String password) {
String request = """<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
<AccessLicenseNumber>${access_license_number}</AccessLicenseNumber>
<UserId>${user_id}</UserId>
<Password>${password}</Password>
</AccessRequest>
<?xml version="1.0"?>
<TrackRequest xml:lang="en-US">
<Request>
<TransactionReference>
<CustomerContext>My Context</CustomerContext>
<XpciVersion>1.0001</XpciVersion>
</TransactionReference>
<RequestAction>Track</RequestAction>
<RequestOption>${action}</RequestOption>
</Request>
<ShipmentIdentificationNumber>${trackingNumber}</ShipmentIdentificationNumber>
</TrackRequest>
""";
def command = [
'sh',
'-c',
"curl -s -w '%{http_code}' '${url}' -X POST -d '" + request + "'"
];
def proc = command.execute();
def outputStream = new StringBuffer();
def errorStream = new StringBuffer();
proc.waitForProcessOutput(outputStream, errorStream);
// System.out.println("error: " + errorStream.toString());
String result = outputStream.toString().trim();
//split off the html status code
String code = result.substring(result.length() -3);
String body = result.substring(0,result.length() -3);
String[] output = [code, body];
return output;
}