< prev index next >

src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java

Print this page




  54 
  55     private X509ExtendedKeyManager keyManager;
  56     private X509TrustManager trustManager;
  57     private SecureRandom secureRandom;
  58 
  59     // DTLS cookie exchange manager
  60     private volatile HelloCookieManager.Builder helloCookieManagerBuilder;
  61 
  62     private final boolean clientEnableStapling = Utilities.getBooleanProperty(
  63             "jdk.tls.client.enableStatusRequestExtension", true);
  64     private final boolean serverEnableStapling = Utilities.getBooleanProperty(
  65             "jdk.tls.server.enableStatusRequestExtension", false);
  66     private static final Collection<CipherSuite> clientCustomizedCipherSuites =
  67             getCustomizedCipherSuites("jdk.tls.client.cipherSuites");
  68     private static final Collection<CipherSuite> serverCustomizedCipherSuites =
  69             getCustomizedCipherSuites("jdk.tls.server.cipherSuites");
  70 
  71     private volatile StatusResponseManager statusResponseManager;
  72 
  73     private final ReentrantLock contextLock = new ReentrantLock();
  74     final HashMap<Integer, SessionTicketExtension.StatelessKey> keyHashMap = new HashMap<>();
  75 
  76 
  77     SSLContextImpl() {
  78         ephemeralKeyManager = new EphemeralKeyManager();
  79         clientCache = new SSLSessionContextImpl(false);
  80         serverCache = new SSLSessionContextImpl(true);
  81     }
  82 
  83     @Override
  84     protected void engineInit(KeyManager[] km, TrustManager[] tm,
  85                                 SecureRandom sr) throws KeyManagementException {
  86         isInitialized = false;
  87         keyManager = chooseKeyManager(km);
  88 
  89         if (tm == null) {
  90             try {
  91                 TrustManagerFactory tmf = TrustManagerFactory.getInstance(
  92                         TrustManagerFactory.getDefaultAlgorithm());
  93                 tmf.init((KeyStore)null);
  94                 tm = tmf.getTrustManagers();
  95             } catch (Exception e) {
  96                 // eat
  97             }
  98         }
  99         trustManager = chooseTrustManager(tm);
 100 




  54 
  55     private X509ExtendedKeyManager keyManager;
  56     private X509TrustManager trustManager;
  57     private SecureRandom secureRandom;
  58 
  59     // DTLS cookie exchange manager
  60     private volatile HelloCookieManager.Builder helloCookieManagerBuilder;
  61 
  62     private final boolean clientEnableStapling = Utilities.getBooleanProperty(
  63             "jdk.tls.client.enableStatusRequestExtension", true);
  64     private final boolean serverEnableStapling = Utilities.getBooleanProperty(
  65             "jdk.tls.server.enableStatusRequestExtension", false);
  66     private static final Collection<CipherSuite> clientCustomizedCipherSuites =
  67             getCustomizedCipherSuites("jdk.tls.client.cipherSuites");
  68     private static final Collection<CipherSuite> serverCustomizedCipherSuites =
  69             getCustomizedCipherSuites("jdk.tls.server.cipherSuites");
  70 
  71     private volatile StatusResponseManager statusResponseManager;
  72 
  73     private final ReentrantLock contextLock = new ReentrantLock();


  74 
  75     SSLContextImpl() {
  76         ephemeralKeyManager = new EphemeralKeyManager();
  77         clientCache = new SSLSessionContextImpl();
  78         serverCache = new SSLSessionContextImpl();
  79     }
  80 
  81     @Override
  82     protected void engineInit(KeyManager[] km, TrustManager[] tm,
  83                                 SecureRandom sr) throws KeyManagementException {
  84         isInitialized = false;
  85         keyManager = chooseKeyManager(km);
  86 
  87         if (tm == null) {
  88             try {
  89                 TrustManagerFactory tmf = TrustManagerFactory.getInstance(
  90                         TrustManagerFactory.getDefaultAlgorithm());
  91                 tmf.init((KeyStore)null);
  92                 tm = tmf.getTrustManagers();
  93             } catch (Exception e) {
  94                 // eat
  95             }
  96         }
  97         trustManager = chooseTrustManager(tm);
  98 


< prev index next >