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

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

Introduction

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

Prototype

public void setTrustStorePassword(String trustStorePassword) 

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);//ww  w. ja  v  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;
}