con = (HttpURLConnection) url2.openConnection();
con.setReadTimeout(10000);
con.setInstanceFollowRedirects(true);
con.setAllowUserInteraction(true);
con.setDoOutput(true);
con.setDoInput(true);
Authenticator.setDefault(new MyAuthenticator());
con.connect();
class MyAuthenticator extends Authenticator {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("myUser", "MyPassword".toCharArray());
}
}
chart
在JRE 6中应该支持NTLMv2。我的困惑在于这是在Android上运行的。在堆栈跟踪中
getOutputStream
我看到的是
HttpURLConnection
被引用。
不管怎样,我想知道这是如何在Java中实现的,而不仅仅是Android。