uc.addRequestProperty("Cookie", headerField);
uc.setDoOutput(true);
uc.getOutputStream().write((param + "&csrf=" + csrf).getBytes("UTF-8"));
uc.addRequestProperty("Cookie", headerField);
uc.setDoOutput(true);
uc.getOutputStream().write((param + "&csrf=" + csrf).getBytes("UTF-8"));
return stripCookie(headerField);
}
public static String login(final PrivateKey pk, final X509Certificate ce) throws NoSuchAlgorithmException, KeyManagementException, IOException, MalformedURLException {
return stripCookie(headerField);
}
public static String login(final PrivateKey pk, final X509Certificate ce) throws NoSuchAlgorithmException, KeyManagementException, IOException, MalformedURLException {
authenticateClientCert(pk, ce, connection);
if (connection.getResponseCode() == 302) {
authenticateClientCert(pk, ce, connection);
if (connection.getResponseCode() == 302) {
- assertEquals("https://" + getServerName().replaceFirst("^www.", "secure.").replaceFirst(":443$", "") + "/", connection.getHeaderField("Location").replaceFirst(":443$", ""));
+ assertEquals("https://" + getSecureServerName() + "/", connection.getHeaderField("Location").replaceFirst(":443$", ""));
}
public static String executeBasicWebInteraction(String cookie, String path, String query, int formIndex) throws IOException, MalformedURLException, UnsupportedEncodingException {
}
public static String executeBasicWebInteraction(String cookie, String path, String query, int formIndex) throws IOException, MalformedURLException, UnsupportedEncodingException {
- URLConnection uc = post(cookie, path, query, formIndex);
+ HttpURLConnection uc = post(cookie, path, query, formIndex);
+ if (uc.getResponseCode() == 302) {
+ return null;
+ }