View Javadoc
1   /**
2    * Logback: the reliable, generic, fast and flexible logging framework.
3    * Copyright (C) 1999-2015, QOS.ch. All rights reserved.
4    *
5    * This program and the accompanying materials are dual-licensed under
6    * either the terms of the Eclipse Public License v1.0 as published by
7    * the Eclipse Foundation
8    *
9    *   or (per the licensee's choosing)
10   *
11   * under the terms of the GNU Lesser General Public License version 2.1
12   * as published by the Free Software Foundation.
13   */
14  package ch.qos.logback.core.net.ssl;
15  
16  /**
17   * An object that has configurable SSL parameters.
18   * <p>
19   * This interface allows us o decouple the {@link ch.qos.logback.core.net.ssl.SSLParametersConfiguration SSLParametersConfiguration}
20   * from {@link javax.net.ssl.SSLSocket SSLSocket} and {@link javax.net.ssl.SSLServerSocket SSLServerSocket} to facilitate unit
21   * testing.
22   *
23   * @author Carl Harris
24   */
25  public interface SSLConfigurable {
26  
27      /**
28       * Gets the set of protocols that the SSL component enables by default.
29       * 
30       * @return protocols (generally a subset of the set returned by
31       *    {@link #getSupportedProtocols()}); the return value may be 
32       *    an empty array but must never be {@code null}.
33       */
34      String[] getDefaultProtocols();
35  
36      /**
37       * Gets the set of protocols that the SSL component supports.
38       * @return protocols supported protocols; the return value may be 
39       *    an empty array but must never be {@code null}.
40       */
41      String[] getSupportedProtocols();
42  
43      /**
44       * Sets the enabled protocols on the SSL component.
45       * 
46       * @param protocols the protocols to enable
47       */
48      void setEnabledProtocols(String[] protocols);
49  
50      /**
51       * Gets the set of cipher suites that the SSL component enables by default.
52       * 
53       * @return cipher suites (generally a subset of the set returned by
54       *    {@link #getSupportedCipherSuites()}); the return value may be 
55       *    an empty array but must never be {@code null}
56       */
57      String[] getDefaultCipherSuites();
58  
59      /**
60       * Gets the set of cipher suites that the SSL component supports.
61       * @return supported cipher suites; the return value may be 
62       *    an empty array but must never be {@code null}
63       */
64      String[] getSupportedCipherSuites();
65  
66      /**
67       * Sets the enabled cipher suites on the SSL component.
68       * @param cipherSuites the cipher suites to enable
69       */
70      void setEnabledCipherSuites(String[] cipherSuites);
71  
72      /**
73       * Sets a flag indicating whether the SSL component should require 
74       * client authentication.
75       * @param state the flag state to set
76       */
77      void setNeedClientAuth(boolean state);
78  
79      /**
80       * Sets a flag indicating whether the SSL component should request 
81       * client authentication.
82       * @param state the flag state to set
83       */
84      void setWantClientAuth(boolean state);
85  
86  }