src/java.base/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java
branchJDK-8145252-TLS13-branch
changeset 56542 56aaa6cb3693
parent 47216 71c04702a3d5
equal deleted inserted replaced
56541:92cbbfc996f3 56542:56aaa6cb3693
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    41  *
    41  *
    42  * @author David Brownell
    42  * @author David Brownell
    43  */
    43  */
    44 public final class SSLSocketFactoryImpl extends SSLSocketFactory {
    44 public final class SSLSocketFactoryImpl extends SSLSocketFactory {
    45 
    45 
    46     private SSLContextImpl context;
    46     private final SSLContextImpl context;
    47 
    47 
    48     /**
    48     /**
    49      * Constructor used to instantiate the default factory. This method is
    49      * Constructor used to instantiate the default factory. This method is
    50      * only called if the old "ssl.SocketFactory.provider" property in the
    50      * only called if the old "ssl.SocketFactory.provider" property in the
    51      * java.security file is set.
    51      * java.security file is set.
   178      * (preventing person-in-the-middle attacks) and where traffic
   178      * (preventing person-in-the-middle attacks) and where traffic
   179      * is encrypted to provide confidentiality.
   179      * is encrypted to provide confidentiality.
   180      */
   180      */
   181     @Override
   181     @Override
   182     public String[] getDefaultCipherSuites() {
   182     public String[] getDefaultCipherSuites() {
   183         return context.getDefaultCipherSuiteList(false).toStringArray();
   183         return CipherSuite.namesOf(context.getDefaultCipherSuites(false));
   184     }
   184     }
   185 
   185 
   186     /**
   186     /**
   187      * Returns the names of the cipher suites which could be enabled for use
   187      * Returns the names of the cipher suites which could be enabled for use
   188      * on an SSL connection.  Normally, only a subset of these will actually
   188      * on an SSL connection.  Normally, only a subset of these will actually
   191      * which do not protect data confidentiality.  Servers may also need
   191      * which do not protect data confidentiality.  Servers may also need
   192      * certain kinds of certificates to use certain cipher suites.
   192      * certain kinds of certificates to use certain cipher suites.
   193      */
   193      */
   194     @Override
   194     @Override
   195     public String[] getSupportedCipherSuites() {
   195     public String[] getSupportedCipherSuites() {
   196         return context.getSupportedCipherSuiteList().toStringArray();
   196         return CipherSuite.namesOf(context.getSupportedCipherSuites());
   197     }
   197     }
   198 }
   198 }