Merge branch 'master' of ssh://git@gitorious.org/yacy/rc1.git

This commit is contained in:
Michael Peter Christen 2013-05-10 12:16:55 +02:00
commit e6c8b545c2
4 changed files with 24 additions and 13 deletions

BIN
defaults/freeworldKeystore Normal file

Binary file not shown.

View File

@ -60,11 +60,16 @@ bindPort =
# If the property keyStore is not specified, then a new keystore file # If the property keyStore is not specified, then a new keystore file
# DATA/SETTINGS/myPeerKeystore will be created. # DATA/SETTINGS/myPeerKeystore will be created.
keyStore = keyStore=defaults/freeworldKeystore
keyStorePassword = keyStorePassword=freeworld
pkcs12ImportFile = pkcs12ImportFile =
pkcs12ImportPwd = pkcs12ImportPwd =
# the keyStore is only used, if server.https is set to true
# if server.https=true, then the YaCy web interface is available at
# https://localhost:<port>/ and not at http://localhost:<port>/
server.https=false
# property that collects the names of all servlets that had been used so far # property that collects the names of all servlets that had been used so far
# that is used to track if the user has already done some configuration steps # that is used to track if the user has already done some configuration steps
# if the used missed configuration steps that should be done, then a help system # if the used missed configuration steps that should be done, then a help system

View File

@ -194,7 +194,7 @@ public class Status
prop.put("host", hostIP != null ? hostIP.getHostAddress() : "Unkown IP"); prop.put("host", hostIP != null ? hostIP.getHostAddress() : "Unkown IP");
// ssl support // ssl support
prop.put("sslSupport", sb.getConfig("keyStore", "").isEmpty() ? "0" : "1"); prop.put("sslSupport", sb.getConfig("keyStore", "").isEmpty() || !sb.getConfigBool("server.https", false) ? 0 : 1);
if ( sb.getConfigBool("remoteProxyUse", false) ) { if ( sb.getConfigBool("remoteProxyUse", false) ) {
prop.put("remoteProxy", "1"); prop.put("remoteProxy", "1");

View File

@ -207,7 +207,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
} }
public boolean withSSL() { public boolean withSSL() {
return this.sslSocketFactory != null; return this.sslSocketFactory != null && this.switchboard.getConfigBool("server.https", false);
} }
public synchronized void init() { public synchronized void init() {
@ -367,7 +367,7 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
controlSocket.setSoTimeout(this.timeout); controlSocket.setSoTimeout(this.timeout);
// wrap this socket // wrap this socket
if (this.sslSocketFactory != null) { if (withSSL()) {
controlSocket = new serverCoreSocket(controlSocket); controlSocket = new serverCoreSocket(controlSocket);
// if the current connection is SSL we need to do a handshake // if the current connection is SSL we need to do a handshake
@ -994,10 +994,19 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
String keyStoreFileName = this.switchboard.getConfig("keyStore", "").trim(); String keyStoreFileName = this.switchboard.getConfig("keyStore", "").trim();
// getting the keystore pwd // getting the keystore pwd
final String keyStorePwd = this.switchboard.getConfig("keyStorePassword", "").trim(); String keyStorePwd = this.switchboard.getConfig("keyStorePassword", "").trim();
// take a look if we have something to import // take a look if we have something to import
final String pkcs12ImportFile = this.switchboard.getConfig("pkcs12ImportFile", "").trim(); final String pkcs12ImportFile = this.switchboard.getConfig("pkcs12ImportFile", "").trim();
// if no keyStore and no import is defined, then set the default key
if (keyStoreFileName.isEmpty() && keyStorePwd.isEmpty() && pkcs12ImportFile.isEmpty()) {
keyStoreFileName = "defaults/freeworldKeystore";
keyStorePwd = "freeworld";
this.switchboard.setConfig("keyStore", keyStoreFileName);
this.switchboard.setConfig("keyStorePassword", keyStorePwd);
}
if (pkcs12ImportFile.length() > 0) { if (pkcs12ImportFile.length() > 0) {
this.log.logInfo("Import certificates from import file '" + pkcs12ImportFile + "'."); this.log.logInfo("Import certificates from import file '" + pkcs12ImportFile + "'.");
@ -1092,13 +1101,10 @@ public final class serverCore extends AbstractBusyThread implements BusyThread {
@Override @Override
public void handshakeCompleted( public void handshakeCompleted(
final HandshakeCompletedEvent event) { final HandshakeCompletedEvent event) {
System.out.println("Handshake finished!"); //System.out.println("Handshake finished!");
System.out.println( //System.out.println("\t CipherSuite:" + event.getCipherSuite());
"\t CipherSuite:" + event.getCipherSuite()); //System.out.println("\t SessionId " + event.getSession());
System.out.println( //System.out.println("\t PeerHost " + event.getSession().getPeerHost());
"\t SessionId " + event.getSession());
System.out.println(
"\t PeerHost " + event.getSession().getPeerHost());
} }
} }
); );