Skip to main content
summaryrefslogtreecommitdiffstats
blob: ae45de39fe6e901039c1d484f00906b898024dbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
package org.eclipse.jetty.server.ssl;
//========================================================================
//Copyright 2011-2012 Mort Bay Consulting Pty. Ltd.
//------------------------------------------------------------------------
//All rights reserved. This program and the accompanying materials
//are made available under the terms of the Eclipse Public License v1.0
//and Apache License v2.0 which accompanies this distribution.
//The Eclipse Public License is available at
//http://www.eclipse.org/legal/epl-v10.html
//The Apache License v2.0 is available at
//http://www.opensource.org/licenses/apache2.0.php
//You may elect to redistribute this code under either of these licenses.
//========================================================================

import java.io.File;
import java.security.SecureRandom;
import java.security.Security;

import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.TrustManagerFactory;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.util.ssl.SslContextFactory;


/* ------------------------------------------------------------ */
/** The interface for SSL connectors and their configuration methods.
 * 
 */
public interface SslConnector extends Connector
{
    @Deprecated
    public static final String DEFAULT_KEYSTORE_ALGORITHM=(Security.getProperty("ssl.KeyManagerFactory.algorithm")==null?"SunX509":Security.getProperty("ssl.KeyManagerFactory.algorithm"));
    @Deprecated
    public static final String DEFAULT_TRUSTSTORE_ALGORITHM=(Security.getProperty("ssl.TrustManagerFactory.algorithm")==null?"SunX509":Security.getProperty("ssl.TrustManagerFactory.algorithm"));

    /** Default value for the keystore location path. @deprecated */
    @Deprecated
    public static final String DEFAULT_KEYSTORE = System.getProperty("user.home") + File.separator + ".keystore";
    
    /** String name of key password property. @deprecated */
    @Deprecated
    public static final String KEYPASSWORD_PROPERTY = "org.eclipse.jetty.ssl.keypassword";
    
    /** String name of keystore password property. @deprecated */
    @Deprecated
    public static final String PASSWORD_PROPERTY = "org.eclipse.jetty.ssl.password";
    
    
    /* ------------------------------------------------------------ */
    /**
     * @return the instance of SslContextFactory associated with the connector
     */
    public SslContextFactory getSslContextFactory();
        
    /* ------------------------------------------------------------ */
    /**
     * @return The array of Ciphersuite names to exclude from 
     * {@link SSLEngine#setEnabledCipherSuites(String[])}
     * @deprecated
     */
    @Deprecated
    public abstract String[] getExcludeCipherSuites();

    /* ------------------------------------------------------------ */
    /**
     * @param cipherSuites The array of Ciphersuite names to exclude from 
     * {@link SSLEngine#setEnabledCipherSuites(String[])}
     * @deprecated
     */
    @Deprecated
    public abstract void setExcludeCipherSuites(String[] cipherSuites);

    /* ------------------------------------------------------------ */
    /**
     * @return The array of Ciphersuite names to include in
     * {@link SSLEngine#setEnabledCipherSuites(String[])}
     * @deprecated
     */
    @Deprecated
    public abstract String[] getIncludeCipherSuites();

    /* ------------------------------------------------------------ */
    /**
     * @param cipherSuites The array of Ciphersuite names to include in 
     * {@link SSLEngine#setEnabledCipherSuites(String[])}
     * @deprecated
     */
    @Deprecated
    public abstract void setIncludeCipherSuites(String[] cipherSuites);

    /* ------------------------------------------------------------ */
    /**
     * @param password The password for the key store
     * @deprecated
     */
    @Deprecated
    public abstract void setPassword(String password);

    /* ------------------------------------------------------------ */
    /**
     * @param password The password for the trust store
     * @deprecated
     */
    @Deprecated
    public abstract void setTrustPassword(String password);

    /* ------------------------------------------------------------ */
    /**
     * @param password The password (if any) for the specific key within 
     * the key store
     * @deprecated
     */
    @Deprecated
    public abstract void setKeyPassword(String password);

    /* ------------------------------------------------------------ */
    /**
     * @return The SSL protocol (default "TLS") passed to {@link SSLContext#getInstance(String, String)}
     * @deprecated
     */
    @Deprecated
    public abstract String getProtocol();

    /* ------------------------------------------------------------ */
    /**
     * @param protocol The SSL protocol (default "TLS") passed to {@link SSLContext#getInstance(String, String)}
     * @deprecated
     */
    @Deprecated
    public abstract void setProtocol(String protocol);

    /* ------------------------------------------------------------ */
    /**
     * @param keystore The file or URL of the SSL Key store.
     * @deprecated
     */
    @Deprecated
    public abstract void setKeystore(String keystore);

    /* ------------------------------------------------------------ */
    /**
     * @return The file or URL of the SSL Key store.
     * @deprecated
     */
    @Deprecated
    public abstract String getKeystore();

    /* ------------------------------------------------------------ */
    /**
     * @return The type of the key store (default "JKS")
     * @deprecated
     */
    @Deprecated
    public abstract String getKeystoreType();

    /* ------------------------------------------------------------ */
    /**
     * @return True if SSL needs client authentication.
     * @see SSLEngine#getNeedClientAuth()
     * @deprecated
     */
    @Deprecated
    public abstract boolean getNeedClientAuth();

    /* ------------------------------------------------------------ */
    /**
     * @return True if SSL wants client authentication.
     * @see SSLEngine#getWantClientAuth()
     * @deprecated
     */
    @Deprecated
    public abstract boolean getWantClientAuth();

    /* ------------------------------------------------------------ */
    /**
     * @param needClientAuth True if SSL needs client authentication.
     * @see SSLEngine#getNeedClientAuth()
     * @deprecated
     */
    @Deprecated
    public abstract void setNeedClientAuth(boolean needClientAuth);

    /* ------------------------------------------------------------ */
    /**
     * @param wantClientAuth True if SSL wants client authentication.
     * @see SSLEngine#getWantClientAuth()
     * @deprecated
     */
    @Deprecated
    public abstract void setWantClientAuth(boolean wantClientAuth);

    /* ------------------------------------------------------------ */
    /**
     * @param keystoreType The type of the key store (default "JKS")
     * @deprecated
     */
    @Deprecated
    public abstract void setKeystoreType(String keystoreType);

    /* ------------------------------------------------------------ */
    /**
     * @return The SSL provider name, which if set is passed to 
     * {@link SSLContext#getInstance(String, String)}
     * @deprecated
     */
    @Deprecated
    public abstract String getProvider();

    /* ------------------------------------------------------------ */
    /**
     * @return The algorithm name, which if set is passed to 
     * {@link SecureRandom#getInstance(String)} to obtain the {@link SecureRandom}
     * instance passed to {@link SSLContext#init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], SecureRandom)}
     * @deprecated
     */
    @Deprecated
    public abstract String getSecureRandomAlgorithm();

    /* ------------------------------------------------------------ */
    /**
     * @return The algorithm name (default "SunX509") used by the {@link KeyManagerFactory}
     * @deprecated
     */
    @Deprecated
    public abstract String getSslKeyManagerFactoryAlgorithm();

    /* ------------------------------------------------------------ */
    /**
     * @return The algorithm name (default "SunX509") used by the {@link TrustManagerFactory}
     * @deprecated
     */
    @Deprecated
    public abstract String getSslTrustManagerFactoryAlgorithm();

    /* ------------------------------------------------------------ */
    /**
     * @return The file name or URL of the trust store location
     * @deprecated
     */
    @Deprecated
    public abstract String getTruststore();

    /* ------------------------------------------------------------ */
    /**
     * @return The type of the trust store (default "JKS")
     * @deprecated
     */
    @Deprecated
    public abstract String getTruststoreType();

    /* ------------------------------------------------------------ */
    /**
     * @param provider The SSL provider name, which if set is passed to 
     * {@link SSLContext#getInstance(String, String)}
     * @deprecated
     */
    @Deprecated
    public abstract void setProvider(String provider);

    /* ------------------------------------------------------------ */
    /**
     * @param algorithm The algorithm name, which if set is passed to 
     * {@link SecureRandom#getInstance(String)} to obtain the {@link SecureRandom}
     * instance passed to {@link SSLContext#init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], SecureRandom)}
     * @deprecated
     */
    @Deprecated
    public abstract void setSecureRandomAlgorithm(String algorithm);

    /* ------------------------------------------------------------ */
    /**
     * @param algorithm The algorithm name (default "SunX509") used by 
     * the {@link KeyManagerFactory}
     * @deprecated
     */
    @Deprecated
    public abstract void setSslKeyManagerFactoryAlgorithm(String algorithm);

    /* ------------------------------------------------------------ */
    /**
     * @param algorithm The algorithm name (default "SunX509") used by the {@link TrustManagerFactory}
     * @deprecated
     */
    @Deprecated
    public abstract void setSslTrustManagerFactoryAlgorithm(String algorithm);

    /* ------------------------------------------------------------ */
    /**
     * @param truststore The file name or URL of the trust store location
     * @deprecated
     */
    @Deprecated
    public abstract void setTruststore(String truststore);

    /* ------------------------------------------------------------ */
    /**
     * @param truststoreType The type of the trust store (default "JKS")
     * @deprecated
     */
    @Deprecated
    public abstract void setTruststoreType(String truststoreType);

    /* ------------------------------------------------------------ */
    /**
     * @param sslContext Set a preconfigured SSLContext
     * @deprecated
     */
    @Deprecated
    public abstract void setSslContext(SSLContext sslContext);
    
    /* ------------------------------------------------------------ */
    /**
     * @return The SSLContext
     * @deprecated
     */
    @Deprecated
    public abstract SSLContext getSslContext();
    

    /* ------------------------------------------------------------ */
    /**
     * @return True if SSL re-negotiation is allowed (default false)
     * @deprecated
     */
    @Deprecated
    public boolean isAllowRenegotiate();

    /* ------------------------------------------------------------ */
    /**
     * Set if SSL re-negotiation is allowed. CVE-2009-3555 discovered
     * a vulnerability in SSL/TLS with re-negotiation.  If your JVM
     * does not have CVE-2009-3555 fixed, then re-negotiation should 
     * not be allowed.
     * @param allowRenegotiate true if re-negotiation is allowed (default false)
     * @deprecated
     */
    @Deprecated
    public void setAllowRenegotiate(boolean allowRenegotiate);
}

Back to the top