如何访问“MD2withRSA被禁用”的https网站遇到了 [英] How to access https website where "MD2withRSA is disabled" is encountered
问题描述
我收到以下异常消息: javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException:PKIX路径验证失败:java.security.cert.CertPathValidatorException:算法检查失败:MD2withRSA被禁用
我明白,从Java 6 rel 17支持MD2withRSA被禁用。不幸的是,我正在尝试连接到使用过时软件的网站,我没有权力更新它。我不想收回我的java版本(目前是java 6 rel 20),因为我不希望这个项目受到限制。
这意味着我需要客户端绕过这个问题。我正在使用一些我已经提供的代码,但我认为它是为旧版本的java编写的:
HttpsURLConnection huc =(HttpsURLConnection)新的URL(URL + URL_LOGIN).openConnection();
huc.setDoOutput(true);
huc.setRequestMethod(POST);
huc.setRequestProperty(Content-Type,application / x-www-form-urlencoded);
OutputStream os = huc.getOutputStream(); //异常抛出
os.write((password =+ webSitePassword +& submit:login = Login& username =+ webSiteUsername).getBytes(UTF-8) );
os.flush();
os.close();
huc.connect();
任何人都可以提供我的工作,不涉及收回我的java版本或更新服务器?
我已经将我的Java版本更新为Java 6 Update 30,我不再收到异常。 / p>
此博客表示此更新21中已修复此问题。
根据我一直在阅读此问题的帖子,影响Java 1.6更新17至20
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?
I've updated my java version to Java 6 Update 30 and I'm no longer getting the exception.
This blog indicates that this issue was fixed in Update 21.
Based on the posts I've been reading this issue affects Java 1.6 Updates 17 through to 20
这篇关于如何访问“MD2withRSA被禁用”的https网站遇到了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!