I'm getting the following exception message: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: algorithm check failed: MD2withRSA is disabled
I understand that as of java 6 rel 17 support for MD2withRSA was disabled. Unfortunately I'm trying to connect to a site which is using outdated software and I don't have the power to update it. I've no intention of taking back my java version (currently java 6 rel 20) as I don't want the project restricted by this.
This means that I need to get round this issue client side. I'm using some code that I've been provided with but I assume it was written for an older version of java:
HttpsURLConnection huc = (HttpsURLConnection) new URL(URL + URL_LOGIN).openConnection();
huc.setDoOutput(true);
huc.setRequestMethod("POST");
huc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
OutputStream os = huc.getOutputStream(); // exception is thrown here
os.write(("password=" + webSitePassword + "&submit:login=Login&username=" + webSiteUsername).getBytes("UTF-8"));
os.flush();
os.close();
huc.connect();
Can anyone provide me with a work around which doesn't involve taking back my java version or updating the server?