com.aol.micro.server.servers.tomcat.SSLConfigurationBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro-tomcat Show documentation
Show all versions of micro-tomcat Show documentation
Opinionated rest microservices
package com.aol.micro.server.servers.tomcat;
import org.apache.coyote.http11.AbstractHttp11JsseProtocol;
import com.aol.micro.server.config.SSLProperties;
public class SSLConfigurationBuilder {
public void build(AbstractHttp11JsseProtocol> protocol,SSLProperties sslProperties) {
protocol.setKeystoreFile(sslProperties.getKeyStoreFile()); // contains server keypair
protocol.setKeyPass(sslProperties.getKeyStorePass());
sslProperties.getKeyStoreType().ifPresent(type->protocol.setKeystoreType(type));
sslProperties.getKeyStoreProvider().ifPresent(provider->protocol.setKeystoreProvider(provider));
sslProperties.getTrustStoreFile().ifPresent(file->protocol.setTruststoreFile(file)); // contains client certificate
sslProperties.getTrustStorePass().ifPresent(pass->protocol.setTruststorePass(pass));
sslProperties.getTrustStoreType().ifPresent(type->protocol.setTruststoreType(type));
sslProperties.getTrustStoreProvider().ifPresent(provider->protocol.setTruststoreProvider(provider));
sslProperties.getClientAuth().ifPresent(auth->protocol.setClientAuth(auth));
protocol.setSSLEnabled(true);
sslProperties.getCiphers().ifPresent(ciphers->protocol.setCiphers(ciphers));
sslProperties.getProtocol().ifPresent(pr->protocol.setSslProtocol(pr));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy