0
我需要從具有本地證書並需要用戶名/密碼身份驗證的HTTPS頁面讀取一些數據。使用用戶名/密碼身份驗證讀取HTTPS頁面並忽略certifiacte
使用「HttpURLConnection」,是否可以執行用戶名/密碼認證並導入本地證書或忽略它?
很多謝謝,
我需要從具有本地證書並需要用戶名/密碼身份驗證的HTTPS頁面讀取一些數據。使用用戶名/密碼身份驗證讀取HTTPS頁面並忽略certifiacte
使用「HttpURLConnection」,是否可以執行用戶名/密碼認證並導入本地證書或忽略它?
很多謝謝,
試着用這個。爲我工作。
private void authenticadorRedeTendencia() {
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(userName(), password.toCharArray());
}
});
}