17329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom/* 27329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * Licensed to the Apache Software Foundation (ASF) under one or more 37329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * contributor license agreements. See the NOTICE file distributed with 47329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * this work for additional information regarding copyright ownership. 57329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * The ASF licenses this file to You under the Apache License, Version 2.0 67329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * (the "License"); you may not use this file except in compliance with 77329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * the License. You may obtain a copy of the License at 87329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * 97329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * http://www.apache.org/licenses/LICENSE-2.0 107329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * 117329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * Unless required by applicable law or agreed to in writing, software 127329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * distributed under the License is distributed on an "AS IS" BASIS, 137329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 147329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * See the License for the specific language governing permissions and 157329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * limitations under the License. 167329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 177329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1838375a4d0b3d34e2babbd2f6a013976c7c439696Kenny Rootpackage org.conscrypt; 197329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 207329fa972d9c20777444e5e1b13169d700de6567Brian Carlstromimport java.io.IOException; 217329fa972d9c20777444e5e1b13169d700de6567Brian Carlstromimport java.net.InetAddress; 227329fa972d9c20777444e5e1b13169d700de6567Brian Carlstromimport java.net.Socket; 237329fa972d9c20777444e5e1b13169d700de6567Brian Carlstromimport javax.net.ssl.SSLServerSocket; 247329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 257329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom/** 267329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * SSLServerSocket implementation 277329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket class documentation for more information. 287329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 297329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrompublic class SSLServerSocketImpl extends SSLServerSocket { 307329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 317329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // the sslParameters object encapsulates all the info 327329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // about supported and enabled cipher suites and protocols, 337329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // as well as the information about client/server mode of 347329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // ssl socket, whether it require/want client authentication or not, 357329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // and controls whether new SSL sessions may be established by this 367329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // socket or not. 376812a2e8bb43d9a875633a9ba255d9882c63e327Brian Carlstrom private final SSLParametersImpl sslParameters; 387329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 397329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // logger 407329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom private Logger.Stream logger = Logger.getStream("ssocket"); 417329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 427329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 437329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * Ctor 447329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param sslParameters: SSLParameters 457329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @throws IOException 467329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 4732c2297a959b72abdb18743f0519e1d8b7c7ea88Elliott Hughes protected SSLServerSocketImpl(SSLParametersImpl sslParameters) throws IOException { 487329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom this.sslParameters = sslParameters; 497329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 507329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 517329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 527329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * Ctor 537329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param port: int 547329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param sslParameters: SSLParameters 557329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @throws IOException 567329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 576812a2e8bb43d9a875633a9ba255d9882c63e327Brian Carlstrom protected SSLServerSocketImpl(int port, SSLParametersImpl sslParameters) 587329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom throws IOException { 597329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom super(port); 607329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom this.sslParameters = sslParameters; 617329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 627329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 637329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 647329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * Ctor 657329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param port: int 667329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param backlog: int 677329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param sslParameters: SSLParameters 687329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @throws IOException 697329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 707329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom protected SSLServerSocketImpl(int port, int backlog, 716812a2e8bb43d9a875633a9ba255d9882c63e327Brian Carlstrom SSLParametersImpl sslParameters) throws IOException { 727329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom super(port, backlog); 737329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom this.sslParameters = sslParameters; 747329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 757329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 767329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 777329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * Ctor 787329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param port: int 797329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param backlog: int 807329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param iAddress: InetAddress 817329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @param sslParameters: SSLParameters 827329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @throws IOException 837329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 847329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom protected SSLServerSocketImpl(int port, int backlog, 857329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom InetAddress iAddress, 866812a2e8bb43d9a875633a9ba255d9882c63e327Brian Carlstrom SSLParametersImpl sslParameters) 877329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom throws IOException { 887329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom super(port, backlog, iAddress); 897329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom this.sslParameters = sslParameters; 907329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 917329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 927329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // --------------- SSLParameters based methods --------------------- 937329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 947329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 957329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 967329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getSupportedCipherSuites() 977329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 987329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 997329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1007329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public String[] getSupportedCipherSuites() { 1017329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return CipherSuite.getSupportedCipherSuiteNames(); 1027329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1037329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1047329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1057329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1067329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getEnabledCipherSuites() 1077329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1087329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1097329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1107329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public String[] getEnabledCipherSuites() { 1117329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return sslParameters.getEnabledCipherSuites(); 1127329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1137329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1147329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1157329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1167329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#setEnabledCipherSuites(String[]) 1177329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1187329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1197329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1207329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public void setEnabledCipherSuites(String[] suites) { 1217329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom sslParameters.setEnabledCipherSuites(suites); 1227329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1237329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1247329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1257329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1267329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getSupportedProtocols() 1277329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1287329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1297329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1307329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public String[] getSupportedProtocols() { 1317329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return ProtocolVersion.supportedProtocols.clone(); 1327329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1337329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1347329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1357329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1367329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getEnabledProtocols() 1377329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1387329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1397329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1407329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public String[] getEnabledProtocols() { 1417329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return sslParameters.getEnabledProtocols(); 1427329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1437329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1447329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1457329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1467329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#setEnabledProtocols(String[]) 1477329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1487329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1497329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1507329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public void setEnabledProtocols(String[] protocols) { 1517329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom sslParameters.setEnabledProtocols(protocols); 1527329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1537329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1547329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1557329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1567329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#setUseClientMode(boolean) 1577329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1587329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1597329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1607329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public void setUseClientMode(boolean mode) { 1617329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom sslParameters.setUseClientMode(mode); 1627329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1637329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1647329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1657329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1667329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getUseClientMode() 1677329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1687329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1697329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1707329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public boolean getUseClientMode() { 1717329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return sslParameters.getUseClientMode(); 1727329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1737329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1747329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1757329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1767329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#setNeedClientAuth(boolean) 1777329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1787329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1797329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1807329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public void setNeedClientAuth(boolean need) { 1817329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom sslParameters.setNeedClientAuth(need); 1827329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1837329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1847329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1857329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1867329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getNeedClientAuth() 1877329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1887329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1897329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 1907329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public boolean getNeedClientAuth() { 1917329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return sslParameters.getNeedClientAuth(); 1927329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 1937329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 1947329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 1957329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 1967329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#setWantClientAuth(boolean) 1977329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 1987329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 1997329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 2007329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public void setWantClientAuth(boolean want) { 2017329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom sslParameters.setWantClientAuth(want); 2027329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2037329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2047329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 2057329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 2067329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getWantClientAuth() 2077329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 2087329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 2097329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 2107329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public boolean getWantClientAuth() { 2117329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return sslParameters.getWantClientAuth(); 2127329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2137329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2147329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 2157329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 2167329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#setEnableSessionCreation(boolean) 2177329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 2187329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 2197329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 2207329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public void setEnableSessionCreation(boolean flag) { 2217329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom sslParameters.setEnableSessionCreation(flag); 2227329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2237329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2247329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 2257329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 2267329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see javax.net.ssl.SSLServerSocket#getEnableSessionCreation() 2277329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 2287329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 2297329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 2307329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public boolean getEnableSessionCreation() { 2317329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return sslParameters.getEnableSessionCreation(); 2327329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2337329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2347329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2357329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // ------------- ServerSocket's methods overridings ---------------- 2367329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2377329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 2387329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * This method works according to the specification of implemented class. 2397329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * @see java.net.ServerSocket#accept() 2407329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * method documentation for more information 2417329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 2427329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 2437329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public Socket accept() throws IOException { 2447329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom if (logger != null) { 2457329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom logger.println("SSLServerSocketImpl.accept .."); 2467329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2477329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom SSLSocketImpl s = new SSLSocketImpl( 2486812a2e8bb43d9a875633a9ba255d9882c63e327Brian Carlstrom (SSLParametersImpl) sslParameters.clone()); 2497329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom implAccept(s); 2507329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom s.init(); 2517329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom if (logger != null) { 2527329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom logger.println("SSLServerSocketImpl: accepted, initialized"); 2537329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2547329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return s; 2557329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2567329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2577329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom /** 2587329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom * Returns the string representation of the object. 2597329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom */ 2607329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom @Override 2617329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom public String toString() { 2627329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom return "[SSLServerSocketImpl]"; 2637329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom } 2647329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom 2657329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom // ----------------------------------------------------------------- 2667329fa972d9c20777444e5e1b13169d700de6567Brian Carlstrom} 267