import java.net.HttpURLConnection;
import java.net.URL;
+import org.cacert.gigi.dbObjects.CertificateOwner;
import org.cacert.gigi.dbObjects.Domain;
-import org.cacert.gigi.dbObjects.User;
public class HTTPFetch extends DomainPinger {
@Override
- public void ping(Domain domain, String expToken, User user, int confId) {
+ public void ping(Domain domain, String expToken, CertificateOwner user, int confId) {
try {
String[] tokenParts = expToken.split(":", 2);
URL u = new URL("http://" + domain.getSuffix() + "/cacert-" + tokenParts[0] + ".txt");
HttpURLConnection huc = (HttpURLConnection) u.openConnection();
if (huc.getResponseCode() != 200) {
- enterPingResult(confId, "error", "Invaild status code " + huc.getResponseCode() + ".", null);
+ enterPingResult(confId, "error", "Invalid status code " + huc.getResponseCode() + ".", null);
return;
}
BufferedReader br = new BufferedReader(new InputStreamReader(huc.getInputStream(), "UTF-8"));
enterPingResult(confId, PING_SUCCEDED, "", null);
return;
}
- enterPingResult(confId, "error", "Challange tokens differed.", null);
+ enterPingResult(confId, "error", "Challenge tokens differed.", null);
return;
} catch (IOException e) {
e.printStackTrace();