Fork me on GitHub

Methanol - Example SSL Client Configuration

import com.github.mizosoft.methanol.Methanol;
import nl.altindag.sslcontext.SSLFactory;

public class App {

    public static void main(String[] args) throws Exception {
        SSLFactory sslFactory = SSLFactory.builder()
                .withIdentityMaterial("identity.jks", "password".toCharArray())
                .withTrustMaterial("truststore.jks", "password".toCharArray())
                .build();

        Methanol methanol = Methanol.newBuilder()
                .sslContext(sslFactory.getSslContext())
                .sslParameters(sslFactory.getSslParameters())
                .build();
    }

}
Click here to discover all other possible configurations for the SSLFactory.