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

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

Introduction

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

Prototype

public void setTrustStore(String trustStore) 

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);// www  .  j  ava2 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;
}