/jetty-server/src/main/java/org/eclipse/jetty/server/ssl/SslConnector.java

https://github.com/dekellum/jetty · Java · 330 lines · 90 code · 44 blank · 196 comment · 0 complexity · 201ff48156c43c95de4578a0778b09a5 MD5 · raw file

  1. package org.eclipse.jetty.server.ssl;
  2. import java.io.File;
  3. import java.security.SecureRandom;
  4. import java.security.Security;
  5. import javax.net.ssl.KeyManagerFactory;
  6. import javax.net.ssl.SSLContext;
  7. import javax.net.ssl.SSLEngine;
  8. import javax.net.ssl.TrustManagerFactory;
  9. import org.eclipse.jetty.http.ssl.SslContextFactory;
  10. import org.eclipse.jetty.server.Connector;
  11. /* ------------------------------------------------------------ */
  12. /** The interface for SSL connectors and their configuration methods.
  13. *
  14. */
  15. public interface SslConnector extends Connector
  16. {
  17. @Deprecated
  18. public static final String DEFAULT_KEYSTORE_ALGORITHM=(Security.getProperty("ssl.KeyManagerFactory.algorithm")==null?"SunX509":Security.getProperty("ssl.KeyManagerFactory.algorithm"));
  19. @Deprecated
  20. public static final String DEFAULT_TRUSTSTORE_ALGORITHM=(Security.getProperty("ssl.TrustManagerFactory.algorithm")==null?"SunX509":Security.getProperty("ssl.TrustManagerFactory.algorithm"));
  21. /** Default value for the keystore location path. @deprecated */
  22. @Deprecated
  23. public static final String DEFAULT_KEYSTORE = System.getProperty("user.home") + File.separator + ".keystore";
  24. /** String name of key password property. @deprecated */
  25. @Deprecated
  26. public static final String KEYPASSWORD_PROPERTY = "org.eclipse.jetty.ssl.keypassword";
  27. /** String name of keystore password property. @deprecated */
  28. @Deprecated
  29. public static final String PASSWORD_PROPERTY = "org.eclipse.jetty.ssl.password";
  30. /* ------------------------------------------------------------ */
  31. /**
  32. * @return the instance of SslContextFactory associated with the connector
  33. */
  34. public SslContextFactory getSslContextFactory();
  35. /* ------------------------------------------------------------ */
  36. /**
  37. * @return The array of Ciphersuite names to exclude from
  38. * {@link SSLEngine#setEnabledCipherSuites(String[])}
  39. * @deprecated
  40. */
  41. @Deprecated
  42. public abstract String[] getExcludeCipherSuites();
  43. /* ------------------------------------------------------------ */
  44. /**
  45. * @param cipherSuites The array of Ciphersuite names to exclude from
  46. * {@link SSLEngine#setEnabledCipherSuites(String[])}
  47. * @deprecated
  48. */
  49. @Deprecated
  50. public abstract void setExcludeCipherSuites(String[] cipherSuites);
  51. /* ------------------------------------------------------------ */
  52. /**
  53. * @return The array of Ciphersuite names to include in
  54. * {@link SSLEngine#setEnabledCipherSuites(String[])}
  55. * @deprecated
  56. */
  57. @Deprecated
  58. public abstract String[] getIncludeCipherSuites();
  59. /* ------------------------------------------------------------ */
  60. /**
  61. * @param cipherSuites The array of Ciphersuite names to include in
  62. * {@link SSLEngine#setEnabledCipherSuites(String[])}
  63. * @deprecated
  64. */
  65. @Deprecated
  66. public abstract void setIncludeCipherSuites(String[] cipherSuites);
  67. /* ------------------------------------------------------------ */
  68. /**
  69. * @param password The password for the key store
  70. * @deprecated
  71. */
  72. @Deprecated
  73. public abstract void setPassword(String password);
  74. /* ------------------------------------------------------------ */
  75. /**
  76. * @param password The password for the trust store
  77. * @deprecated
  78. */
  79. @Deprecated
  80. public abstract void setTrustPassword(String password);
  81. /* ------------------------------------------------------------ */
  82. /**
  83. * @param password The password (if any) for the specific key within
  84. * the key store
  85. * @deprecated
  86. */
  87. @Deprecated
  88. public abstract void setKeyPassword(String password);
  89. /* ------------------------------------------------------------ */
  90. /**
  91. * @return The SSL protocol (default "TLS") passed to {@link SSLContext#getInstance(String, String)}
  92. * @deprecated
  93. */
  94. @Deprecated
  95. public abstract String getProtocol();
  96. /* ------------------------------------------------------------ */
  97. /**
  98. * @param protocol The SSL protocol (default "TLS") passed to {@link SSLContext#getInstance(String, String)}
  99. * @deprecated
  100. */
  101. @Deprecated
  102. public abstract void setProtocol(String protocol);
  103. /* ------------------------------------------------------------ */
  104. /**
  105. * @param keystore The file or URL of the SSL Key store.
  106. * @deprecated
  107. */
  108. @Deprecated
  109. public abstract void setKeystore(String keystore);
  110. /* ------------------------------------------------------------ */
  111. /**
  112. * @return The file or URL of the SSL Key store.
  113. * @deprecated
  114. */
  115. @Deprecated
  116. public abstract String getKeystore();
  117. /* ------------------------------------------------------------ */
  118. /**
  119. * @return The type of the key store (default "JKS")
  120. * @deprecated
  121. */
  122. @Deprecated
  123. public abstract String getKeystoreType();
  124. /* ------------------------------------------------------------ */
  125. /**
  126. * @return True if SSL needs client authentication.
  127. * @see SSLEngine#getNeedClientAuth()
  128. * @deprecated
  129. */
  130. @Deprecated
  131. public abstract boolean getNeedClientAuth();
  132. /* ------------------------------------------------------------ */
  133. /**
  134. * @return True if SSL wants client authentication.
  135. * @see SSLEngine#getWantClientAuth()
  136. * @deprecated
  137. */
  138. @Deprecated
  139. public abstract boolean getWantClientAuth();
  140. /* ------------------------------------------------------------ */
  141. /**
  142. * @param needClientAuth True if SSL needs client authentication.
  143. * @see SSLEngine#getNeedClientAuth()
  144. * @deprecated
  145. */
  146. @Deprecated
  147. public abstract void setNeedClientAuth(boolean needClientAuth);
  148. /* ------------------------------------------------------------ */
  149. /**
  150. * @param wantClientAuth True if SSL wants client authentication.
  151. * @see SSLEngine#getWantClientAuth()
  152. * @deprecated
  153. */
  154. @Deprecated
  155. public abstract void setWantClientAuth(boolean wantClientAuth);
  156. /* ------------------------------------------------------------ */
  157. /**
  158. * @param keystoreType The type of the key store (default "JKS")
  159. * @deprecated
  160. */
  161. @Deprecated
  162. public abstract void setKeystoreType(String keystoreType);
  163. /* ------------------------------------------------------------ */
  164. /**
  165. * @return The SSL provider name, which if set is passed to
  166. * {@link SSLContext#getInstance(String, String)}
  167. * @deprecated
  168. */
  169. @Deprecated
  170. public abstract String getProvider();
  171. /* ------------------------------------------------------------ */
  172. /**
  173. * @return The algorithm name, which if set is passed to
  174. * {@link SecureRandom#getInstance(String)} to obtain the {@link SecureRandom}
  175. * instance passed to {@link SSLContext#init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], SecureRandom)}
  176. * @deprecated
  177. */
  178. @Deprecated
  179. public abstract String getSecureRandomAlgorithm();
  180. /* ------------------------------------------------------------ */
  181. /**
  182. * @return The algorithm name (default "SunX509") used by the {@link KeyManagerFactory}
  183. * @deprecated
  184. */
  185. @Deprecated
  186. public abstract String getSslKeyManagerFactoryAlgorithm();
  187. /* ------------------------------------------------------------ */
  188. /**
  189. * @return The algorithm name (default "SunX509") used by the {@link TrustManagerFactory}
  190. * @deprecated
  191. */
  192. @Deprecated
  193. public abstract String getSslTrustManagerFactoryAlgorithm();
  194. /* ------------------------------------------------------------ */
  195. /**
  196. * @return The file name or URL of the trust store location
  197. * @deprecated
  198. */
  199. @Deprecated
  200. public abstract String getTruststore();
  201. /* ------------------------------------------------------------ */
  202. /**
  203. * @return The type of the trust store (default "JKS")
  204. * @deprecated
  205. */
  206. @Deprecated
  207. public abstract String getTruststoreType();
  208. /* ------------------------------------------------------------ */
  209. /**
  210. * @param provider The SSL provider name, which if set is passed to
  211. * {@link SSLContext#getInstance(String, String)}
  212. * @deprecated
  213. */
  214. @Deprecated
  215. public abstract void setProvider(String provider);
  216. /* ------------------------------------------------------------ */
  217. /**
  218. * @param algorithm The algorithm name, which if set is passed to
  219. * {@link SecureRandom#getInstance(String)} to obtain the {@link SecureRandom}
  220. * instance passed to {@link SSLContext#init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[], SecureRandom)}
  221. * @deprecated
  222. */
  223. @Deprecated
  224. public abstract void setSecureRandomAlgorithm(String algorithm);
  225. /* ------------------------------------------------------------ */
  226. /**
  227. * @param algorithm The algorithm name (default "SunX509") used by
  228. * the {@link KeyManagerFactory}
  229. * @deprecated
  230. */
  231. @Deprecated
  232. public abstract void setSslKeyManagerFactoryAlgorithm(String algorithm);
  233. /* ------------------------------------------------------------ */
  234. /**
  235. * @param algorithm The algorithm name (default "SunX509") used by the {@link TrustManagerFactory}
  236. * @deprecated
  237. */
  238. @Deprecated
  239. public abstract void setSslTrustManagerFactoryAlgorithm(String algorithm);
  240. /* ------------------------------------------------------------ */
  241. /**
  242. * @param truststore The file name or URL of the trust store location
  243. * @deprecated
  244. */
  245. @Deprecated
  246. public abstract void setTruststore(String truststore);
  247. /* ------------------------------------------------------------ */
  248. /**
  249. * @param truststoreType The type of the trust store (default "JKS")
  250. * @deprecated
  251. */
  252. @Deprecated
  253. public abstract void setTruststoreType(String truststoreType);
  254. /* ------------------------------------------------------------ */
  255. /**
  256. * @param sslContext Set a preconfigured SSLContext
  257. * @deprecated
  258. */
  259. @Deprecated
  260. public abstract void setSslContext(SSLContext sslContext);
  261. /* ------------------------------------------------------------ */
  262. /**
  263. * @return The SSLContext
  264. * @deprecated
  265. */
  266. @Deprecated
  267. public abstract SSLContext getSslContext();
  268. /* ------------------------------------------------------------ */
  269. /**
  270. * @return True if SSL re-negotiation is allowed (default false)
  271. * @deprecated
  272. */
  273. @Deprecated
  274. public boolean isAllowRenegotiate();
  275. /* ------------------------------------------------------------ */
  276. /**
  277. * Set if SSL re-negotiation is allowed. CVE-2009-3555 discovered
  278. * a vulnerability in SSL/TLS with re-negotiation. If your JVM
  279. * does not have CVE-2009-3555 fixed, then re-negotiation should
  280. * not be allowed.
  281. * @param allowRenegotiate true if re-negotiation is allowed (default false)
  282. * @deprecated
  283. */
  284. @Deprecated
  285. public void setAllowRenegotiate(boolean allowRenegotiate);
  286. }