From 4a8c39a93ab82ade57f4cae372ea0a870461a1d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20K=C3=B6rber?= Date: Thu, 23 Jan 2020 23:25:08 +0100 Subject: [PATCH] Add SERVFAIL support to challtestsrv client --- .../shredzone/acme4j/it/BammBammClient.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java b/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java index bc9c7626..5b81599e 100644 --- a/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java +++ b/acme4j-it/src/main/java/org/shredzone/acme4j/it/BammBammClient.java @@ -163,6 +163,32 @@ public class BammBammClient { sendRequest("clear-cname", jb.toString()); } + /** + * Simulates a SERVFAIL for the given domain. + * + * @param domain + * Domain that will give a SERVFAIL response + * @since 2.9 + */ + public void dnsAddServFailRecord(String domain) throws IOException { + JSONBuilder jb = new JSONBuilder(); + jb.put("host", domain); + sendRequest("set-servfail", jb.toString()); + } + + /** + * Removes a SERVFAIL Record from the DNS. + * + * @param domain + * Domain to remove the SEVFAIL Record from + * @since 2.9 + */ + public void dnsRemoveServFailRecord(String domain) throws IOException { + JSONBuilder jb = new JSONBuilder(); + jb.put("host", domain); + sendRequest("clear-servfail", jb.toString()); + } + /** * Adds a certificate for TLS-ALPN tests. *