Add CNAME support to challtestsrv client

pull/89/head
Richard Körber 2020-01-23 23:24:53 +01:00
parent aa8706fc96
commit 037d0dc973
No known key found for this signature in database
GPG Key ID: AAB9FD19C78AA3E0
1 changed files with 30 additions and 0 deletions

View File

@ -133,6 +133,36 @@ public class BammBammClient {
sendRequest("clear-txt", jb.toString());
}
/**
* Adds a CNAME Record to the DNS. Only one CNAME Record is supported per domain. If
* another CNAME Record is set, it will replace the existing one.
*
* @param domain
* Domain to add the CNAME Record to
* @param cname
* CNAME Record to add
* @since 2.9
*/
public void dnsAddCnameRecord(String domain, String cname) throws IOException {
JSONBuilder jb = new JSONBuilder();
jb.put("host", domain);
jb.put("target", cname);
sendRequest("set-cname", jb.toString());
}
/**
* Removes a CNAME Record from the DNS.
*
* @param domain
* Domain to remove the CNAME Record from
* @since 2.9
*/
public void dnsRemoveCnameRecord(String domain) throws IOException {
JSONBuilder jb = new JSONBuilder();
jb.put("host", domain);
sendRequest("clear-cname", jb.toString());
}
/**
* Adds a certificate for TLS-ALPN tests.
*