-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathTestTls.java
More file actions
22 lines (17 loc) · 867 Bytes
/
TestTls.java
File metadata and controls
22 lines (17 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import java.net.MalformedURLException;
import java.net.URI;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import com.google.gson.JsonObject;
import com.namelessmc.java_api.NamelessAPI;
import com.namelessmc.java_api.exception.NamelessException;
public class TestTls {
@Test
void checkTlsVersion() throws MalformedURLException, NamelessException {
final NamelessAPI api = NamelessAPI.builder(URI.create("https://check-tls.akamai.io/").toURL(), "").build();
final JsonObject response = api.requests().get("v1/tlsinfo.json");
Assertions.assertEquals(response.get("tls_sni_status").getAsString(), "present");
Assertions.assertEquals(response.get("tls_version").getAsString(), "tls1.3");
Assertions.assertEquals(response.get("tls_sni_value").getAsString(), "check-tls.akamai.io");
}
}