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

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

Introduction

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

Prototype

public void setKeyStore(String keyStore) 

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);/*w w  w  .  j  av a2  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;
}