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  import javax.net.ssl.SSLServerSocket;
17  
18  /**
19   * An {@link SSLConfigurable} wrapper for an {@link SSLServerSocket}.
20   *
21   * @author Carl Harris
22   * @author Bruno Harbulot
23   */
24  public class SSLConfigurableServerSocket implements SSLConfigurable {
25  
26      private final SSLServerSocket delegate;
27  
28      public SSLConfigurableServerSocket(SSLServerSocket delegate) {
29          this.delegate = delegate;
30      }
31  
32      public String[] getDefaultProtocols() {
33          return delegate.getEnabledProtocols();
34      }
35  
36      public String[] getSupportedProtocols() {
37          return delegate.getSupportedProtocols();
38      }
39  
40      public void setEnabledProtocols(String[] protocols) {
41          delegate.setEnabledProtocols(protocols);
42      }
43  
44      public String[] getDefaultCipherSuites() {
45          return delegate.getEnabledCipherSuites();
46      }
47  
48      public String[] getSupportedCipherSuites() {
49          return delegate.getSupportedCipherSuites();
50      }
51  
52      public void setEnabledCipherSuites(String[] suites) {
53          delegate.setEnabledCipherSuites(suites);
54      }
55  
56      public void setNeedClientAuth(boolean state) {
57          delegate.setNeedClientAuth(state);
58      }
59  
60      public void setWantClientAuth(boolean state) {
61          delegate.setWantClientAuth(state);
62      }
63  
64      @Override
65      public void setHostnameVerification(boolean verifyHostname) {
66          // This is not relevant for a server socket
67      }
68  
69  }