import org.cacert.gigi.pages.account.domain.DomainOverview;
import org.cacert.gigi.testUtils.IOUtils;
import org.cacert.gigi.testUtils.PingTest;
-import org.cacert.gigi.testUtils.TestEmailReciever.TestMail;
+import org.cacert.gigi.testUtils.TestEmailReceiver.TestMail;
import org.junit.Test;
public class TestSSL extends PingTest {
sss.close();
}
}
- String content = "newdomain=" + URLEncoder.encode(test, "UTF-8") + //
+ String content = "adddomain&newdomain=" + URLEncoder.encode(test, "UTF-8") + //
"&emailType=y&email=2&SSLType=y" + //
"&ssl-type-0=direct&ssl-port-0=" + port + //
"&ssl-type-1=direct&ssl-port-1=" + port2 + //
boolean secondsSucceeds = sslVariant != 0;
assertTrue(secondsSucceeds ^ acceptSSLServer(sss2));
- TestMail mail = getMailReciever().recieve();
+ TestMail mail = getMailReciever().receive();
if (emailVariant == 0) {
- String link = mail.extractLink();
- new URL(link).openConnection().getHeaderField("");
+ mail.verify();
}
waitForPings(3);
private void createCertificate(String test, CertificateProfile profile) throws GeneralSecurityException, IOException, SQLException, InterruptedException, GigiApiException {
kp = generateKeypair();
String csr = generatePEMCSR(kp, "CN=" + test);
- c = new Certificate(User.getById(userid), "/CN=" + test, "sha256", csr, CSRType.CSR, profile);
+ c = new Certificate(User.getById(id), Certificate.buildDN("CN", test), "sha256", csr, CSRType.CSR, profile);
c.issue(null, "2y").waitFor(60000);
}
private boolean acceptSSLServer(SSLServerSocket sss) throws IOException {
- try {
- Socket s = sss.accept();
+ try (Socket s = sss.accept()) {
s.getOutputStream().write('b');
s.getOutputStream().close();
return true;