From 558fcecb74036f5d51aed13a784237c3d9703906 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20D=C3=B6rre?= Date: Thu, 26 Nov 2015 11:48:11 +0100 Subject: [PATCH] add: Allow specific self-signed certs for ssl-tests --- .../pages/account/domain/PingConfigForm.java | 12 +-- .../pages/account/domain/PingConfigForm.templ | 3 +- src/org/cacert/gigi/ping/SSLPinger.java | 76 ++++++++++++++++--- tests/org/cacert/gigi/ping/TestSSL.java | 64 ++++++++++++++-- .../org/cacert/gigi/util/SimpleSigner.java | 4 +- 5 files changed, 133 insertions(+), 26 deletions(-) diff --git a/src/org/cacert/gigi/pages/account/domain/PingConfigForm.java b/src/org/cacert/gigi/pages/account/domain/PingConfigForm.java index 9e8c0b02..94a0cad0 100644 --- a/src/org/cacert/gigi/pages/account/domain/PingConfigForm.java +++ b/src/org/cacert/gigi/pages/account/domain/PingConfigForm.java @@ -87,9 +87,11 @@ public class PingConfigForm extends Form { case SSL: { doSSL = true; String[] parts = dpc.getInfo().split(":"); - ports[portpos] = Integer.parseInt(parts[0]); - if (parts.length == 2) { - sslTypes[portpos] = SSLType.valueOf(parts[1].toUpperCase()); + tokenName = parts[0]; + tokenValue = parts[1]; + ports[portpos] = Integer.parseInt(parts[2]); + if (parts.length == 4) { + sslTypes[portpos] = SSLType.valueOf(parts[3].toUpperCase()); } else { sslTypes[portpos] = SSLType.DIRECT; } @@ -130,9 +132,9 @@ public class PingConfigForm extends Form { } int portInt = Integer.parseInt(port); if ("direct".equals(type)) { - target.addPing(DomainPingType.SSL, port); + target.addPing(DomainPingType.SSL, tokenName + ":" + tokenValue + ":" + port); } else if (types.contains(type)) { - target.addPing(DomainPingType.SSL, portInt + ":" + type); + target.addPing(DomainPingType.SSL, tokenName + ":" + tokenValue + ":" + portInt + ":" + type); } } diff --git a/src/org/cacert/gigi/pages/account/domain/PingConfigForm.templ b/src/org/cacert/gigi/pages/account/domain/PingConfigForm.templ index 7ad40a7d..51a8f574 100644 --- a/src/org/cacert/gigi/pages/account/domain/PingConfigForm.templ +++ b/src/org/cacert/gigi/pages/account/domain/PingConfigForm.templ @@ -48,7 +48,8 @@ - : + : + /OU=$tokenValue"?>: