Example usage for org.springframework.boot.web.server Ssl setKeyAlias

List of usage examples for org.springframework.boot.web.server Ssl setKeyAlias

Introduction

In this page you can find the example usage for org.springframework.boot.web.server Ssl setKeyAlias.

Prototype

public void setKeyAlias(String keyAlias) 

Source Link

Usage

From source file:org.springframework.boot.web.servlet.server.AbstractServletWebServerFactoryTests.java

private Ssl getSsl(ClientAuth clientAuth, String keyPassword, String keyAlias, String keyStore,
        String trustStore, String[] supportedProtocols, String[] ciphers) {
    Ssl ssl = new Ssl();
    ssl.setClientAuth(clientAuth);/*from   www . jav a  2 s  .  c  o m*/
    if (keyPassword != null) {
        ssl.setKeyPassword(keyPassword);
    }
    if (keyAlias != null) {
        ssl.setKeyAlias(keyAlias);
    }
    if (keyStore != null) {
        ssl.setKeyStore(keyStore);
        ssl.setKeyStorePassword("secret");
        ssl.setKeyStoreType(getStoreType(keyStore));
    }
    if (trustStore != null) {
        ssl.setTrustStore(trustStore);
        ssl.setTrustStorePassword("secret");
        ssl.setTrustStoreType(getStoreType(trustStore));
    }
    if (ciphers != null) {
        ssl.setCiphers(ciphers);
    }
    if (supportedProtocols != null) {
        ssl.setEnabledProtocols(supportedProtocols);
    }
    return ssl;
}