<dependency>
<groupId>io.github.hakky54</groupId>
<artifactId>ayza</artifactId>
<version>10.0.5</version>
</dependency>
implementation 'io.github.hakky54:ayza:10.0.5'
implementation("io.github.hakky54:ayza:10.0.5")
libraryDependencies += "io.github.hakky54" % "ayza" % "10.0.5"
<dependency org="io.github.hakky54" name="ayza" rev="10.0.5"/>
Ayza is a library which provides various utilities to easily configure SSL/TLS for your Http Client and Server. It takes away the verbosity and provides powerful features such as hot reloading of ssl material for rotating certificates without downtime, support for multiple identity and trust materials, support for encrypted pem files, trusting additional certificates at runtime or easily bypassing ssl configuration of other libraries and much more. Please check out the Table of contents to discover all the possibilities which Ayza can offer.
As a Java developer I worked for different kinds of clients. Most of the time the application required to call other microservices within the organization or some other http servers. These requests needed to be secured, and therefore it was required to load the ssl materials into the http client. Each http client may require different input value to enable https requests, and therefore I couldn't just copy-paste my earlier configuration into the new project. The resulting configuration was in my opinion always verbose, not reusable, hard to test and hard to maintain.
As a developer you also need to know how to properly load your file into your application and consume it as a KeyStore instance. Therefore, you also need to understand how to properly create for example a KeyManager and a TrustManager for you SSLContext. Ayza is taking the responsibility of creating an instance of SSLContext from the provided arguments, and it will provide you all the ssl materials which are required to configure 40+ different Http Client for Java, Scala and Kotlin. I wanted the library to be as easy as possible to use for all developers to give them a kickstart when configuring their Http Client. So feel free to provide feedback or feature requests.
The library has been renamed to Ayza in September 2025 as I wanted a shorter name, which is easy to pronounce and to make it easy to remember. Detailed information about the rename can be found here: Renaming project to Ayza
The library by the way also provides other utilities such as: - CertificateExtractingClient - CertificateUtils - HostnameVerifierUtils - KeyStoreUtils - KeyManagerUtils - TrustManagerUtils - PemUtils - ProviderUtils - SSLContextUtils - SSLFactoryUtils - SSLParametersUtils - SSLSessionUtils - SSLSocketUtils
| Java | Kotlin | Scala | Android |
|---|---|---|---|
| 8+ | 1.5+ | 2.11+ | 24+ |
Example configuration with apache http client, or click here to view the other client configurations
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.json.JSONException;
import org.json.JSONObject;
import nl.altindag.ssl.SSLFactory;
public class App {
public static void main(String[] args) throws IOException, JSONException {
SSLFactory sslFactory = SSLFactory.builder()
.withDefaultTrustMaterial()
.build();
HttpClient httpClient = HttpClients.custom()
.setSSLContext(sslFactory.getSslContext())
.setSSLHostnameVerifier(sslFactory.getHostnameVerifier())
.build();
HttpGet request = new HttpGet("https://api.chucknorris.io/jokes/random");
HttpResponse response = httpClient.execute(request);
String chuckNorrisJoke = new JSONObject(EntityUtils.toString(response.getEntity())).getString("value");
System.out.println(String.format("Received the following status code: %d", response.getStatusLine().getStatusCode()));
System.out.println(String.format("Received the following joke: %s", chuckNorrisJoke));
}
}
Response:
Received the following status code: 200
Received the following joke: If a black cat crosses your path, you have bad luck. If Chuck Norris crosses your path, it was nice knowing you.
```text SSLFactory.builder() .withIdentityMateri