1 2 3 27 package org.apache.coyote.tomcat5; 28 29 import java.io.File ; 30 import java.io.FileInputStream ; 31 import java.io.IOException ; 32 import java.net.InetAddress ; 33 import java.net.ServerSocket ; 34 import java.security.KeyStore ; 35 import java.security.KeyStoreException ; 36 import java.security.NoSuchAlgorithmException ; 37 import java.security.UnrecoverableKeyException ; 38 import java.security.KeyManagementException ; 39 import java.security.Security ; 40 import java.security.cert.CertificateException ; 41 42 43 69 70 public class CoyoteServerSocketFactory 71 implements org.apache.catalina.net.ServerSocketFactory { 72 73 private String algorithm = null; 74 private boolean clientAuth = false; 75 private String keystoreFile = 76 System.getProperty("user.home") + File.separator + ".keystore"; 77 private String randomFile = 78 System.getProperty("user.home") + File.separator + "random.pem"; 79 private String rootFile = 80 System.getProperty("user.home") + File.separator + "root.pem"; 81 private String keystorePass = "changeit"; 82 private String keystoreType = "JKS"; 83 private String protocol = "TLS"; 84 private String protocols; 85 private String sslImplementation = null; 86 private String cipherSuites; 87 private String keyAlias; 88 89 91 96 public String getAlgorithm() { 97 return (this.algorithm); 98 } 99 100 105 public void setAlgorithm(String algorithm) { 106 this.algorithm = algorithm; 107 } 108 109 114 public boolean getClientAuth() { 115 return (this.clientAuth); 116 } 117 118 124 public void setClientAuth(boolean clientAuth) { 125 this.clientAuth = clientAuth; 126 } 127 128 133 public String getKeystoreFile() { 134 return (this.keystoreFile); 135 } 136 137 142 public void setKeystoreFile(String keystoreFile) { 143 144 File file = new File (keystoreFile); 145 if (!file.isAbsolute()) 146 file = new File (System.getProperty("catalina.base"), 147 keystoreFile); 148 this.keystoreFile = file.getAbsolutePath(); 149 } 150 151 156 public String getRandomFile() { 157 return (this.randomFile); 158 } 159 160 165 public void setRandomFile(String randomFile) { 166 167 File file = new File (randomFile); 168 if (!file.isAbsolute()) 169 file = new File (System.getProperty("catalina.base"), 170 randomFile); 171 this.randomFile = file.getAbsolutePath(); 172 } 173 174 179 public String getRootFile() { 180 return (this.rootFile); 181 } 182 183 188 public void setRootFile(String rootFile) { 189 190 File file = new File (rootFile); 191 if (!file.isAbsolute()) 192 file = new File (System.getProperty("catalina.base"), 193 rootFile); 194 this.rootFile = file.getAbsolutePath(); 195 } 196 197 202 public String getKeystorePass() { 203 return (this.keystorePass); 204 } 205 206 211 public void setKeystorePass(String keystorePass) { 212 this.keystorePass = keystorePass; 213 } 214 215 220 public String getKeystoreType() { 221 return (this.keystoreType); 222 } 223 224 229 public void setKeystoreType(String keystoreType) { 230 this.keystoreType = keystoreType; 231 } 232 233 238 public String getProtocol() { 239 return (this.protocol); 240 } 241 242 247 public void setProtocol(String protocol) { 248 this.protocol = protocol; 249 } 250 251 256 public String getProtocols() { 257 return this.protocols; 258 } 259 260 265 public void setProtocols(String protocols) { 266 this.protocols = protocols; 267 } 268 269 274 public String getSSLImplementation() { 275 return (this.sslImplementation); 276 } 277 278 283 public void setSSLImplementation(String sslImplementation) { 284 this.sslImplementation = sslImplementation; 285 } 286 287 293 public String getKeyAlias() { 294 return this.keyAlias; 295 } 296 297 304 public void setKeyAlias(String alias) { 305 this.keyAlias = alias; 306 } 307 308 315 public String getCiphers() { 316 return this.cipherSuites; 317 } 318 319 327 public void setCiphers(String ciphers) { 328 this.cipherSuites = ciphers; 329 } 330 331 332 334 335 public ServerSocket createSocket(int port) { 336 return (null); 337 } 338 339 340 public ServerSocket createSocket(int port, int backlog) { 341 return (null); 342 } 343 344 345 public ServerSocket createSocket(int port, int backlog, 346 InetAddress ifAddress) { 347 return (null); 348 } 349 350 351 } 352 | Popular Tags |