Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java	(revision 32356)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/FedoraServiceProxy.java	(revision 32357)
@@ -39,4 +39,5 @@
 import org.greenstone.gsdl3.util.OID;
 import org.greenstone.gsdl3.util.XMLConverter;
+import org.greenstone.util.ProtocolPortProperties;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -142,6 +143,12 @@
 	    globalProperties.load(Class.forName("org.greenstone.util.GlobalProperties").getClassLoader().getResourceAsStream("global.properties"));
 	    String host = globalProperties.getProperty("tomcat.server", "localhost");
-	    String port = globalProperties.getProperty("tomcat.port", "8383");
-	    String protocol = "http";
+	    ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(globalProperties);
+	    if(protocolPortProps.hadError()) {
+		logger.error("Error with port/protocol in global.properties: " + protocolPortProps.getErrorMsg());
+		return false; // configure has failed
+	    }
+	    String protocol = protocolPortProps.getProtocol();
+	    String port = protocolPortProps.getPort();
+
 	    String username = "fedoraIntCallUser"; //"fedoraAdmin"
 	    String password = "changeme"; //"<user password>"
Index: main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ServletRealmCheck.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ServletRealmCheck.java	(revision 32356)
+++ main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/ServletRealmCheck.java	(revision 32357)
@@ -29,4 +29,6 @@
 import java.net.URLConnection;
 import java.util.Properties;
+
+import org.greenstone.util.ProtocolPortProperties;
 
 /**
@@ -86,5 +88,13 @@
 		// get the property value and print it out
 		String servername = buildProps.getProperty("tomcat.server");
-		String port = buildProps.getProperty("tomcat.port");
+		//String protocol = buildProps.getProperty("server.protocol", "http");
+		//String port = buildProps.getProperty("tomcat.port"+protocol, "8383");
+		
+		ProtocolPortProperties protocolPortProps = new ProtocolPortProperties(buildProps);
+		if(protocolPortProps.hadError()) {
+		    throw new Exception("**** ERROR with port and/or protocol in build.properties:\n" + protocolPortProps.getErrorMsg());
+		}
+		String protocol = protocolPortProps.getProtocol();
+		String port = protocolPortProps.getPort();
 		int portNum = Integer.parseInt(port);
 		
@@ -94,5 +104,5 @@
 			urlSuffix = urlSuffix + "&col="+collection;
 		}
-		URL authenticationUrl = new URL("http", servername, portNum, urlSuffix);
+		URL authenticationUrl = new URL(protocol, servername, portNum, urlSuffix);
 		
 		HttpURLConnection conn = (HttpURLConnection)authenticationUrl.openConnection();		
@@ -120,5 +130,5 @@
 		System.out.print(result); // don't add newline to end
 		
-	} catch (IOException ex) {
+	} catch (Exception ex) {
 		ex.printStackTrace();
 	} finally {
Index: main/trunk/greenstone3/src/java/org/greenstone/server/Server3.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/server/Server3.java	(revision 32356)
+++ main/trunk/greenstone3/src/java/org/greenstone/server/Server3.java	(revision 32357)
@@ -11,4 +11,5 @@
 import org.greenstone.server.BaseProperty;
 import org.greenstone.util.GlobalProperties;
+import org.greenstone.util.ProtocolPortProperties;
 import org.greenstone.util.RunAnt;
 
@@ -16,4 +17,5 @@
 {
         String opt_ant_properties = null;
+        ProtocolPortProperties protocolPortProps = null;
 
 	public Server3(String gsdl3_src_home, String lang)
@@ -21,5 +23,18 @@
 		super(gsdl3_src_home, lang, gsdl3_src_home + File.separatorChar + "build.properties", "web"+File.separator+"logs");
 
-		Property = new Server3Property();
+		// config properties are loaded into the config_properties object
+		// now test the port and protocol values are sane or exit.
+		protocolPortProps = new ProtocolPortProperties(config_properties);
+		if(protocolPortProps.hadError()) {
+		    String errorMsg = "Error with port/protocol in " + config_properties_file + ": " + protocolPortProps.getErrorMsg();
+
+		    // print it everywhere, because port/protocol misconfiguration is a fatal error and we're exiting
+		    logger_.error(errorMsg);
+		    System.err.println(errorMsg);
+		    // If error, then quit this app as soon as possible
+		    System.exit(-1);
+		}	
+		
+		Property = protocolPortProps.legacyMode ? new Server3Property() : new Server3Property(protocolPortProps.getProtocol());
 
 		String frame_title = dictionary.get("ServerControl.Frame_Title");
Index: main/trunk/greenstone3/src/java/org/greenstone/server/Server3Property.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/server/Server3Property.java	(revision 32356)
+++ main/trunk/greenstone3/src/java/org/greenstone/server/Server3Property.java	(revision 32357)
@@ -14,3 +14,11 @@
     }
 
+    Server3Property(String protocol)
+    {
+	// Initialising customised final variables 
+	// Version number, WEB_PORT, autoenter, startbrowser
+	// For GS3, the last two are controlled by the same property
+	super("3", "tomcat.port."+protocol, "server.auto.start", "server.auto.start", 
+	      "server.keep.port", "server.external.access");
+    }
 }
Index: main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java
===================================================================
--- main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java	(revision 32356)
+++ main/trunk/greenstone3/src/java/org/greenstone/util/GlobalProperties.java	(revision 32357)
@@ -181,5 +181,8 @@
 
 			//port
-			portSpecifier = properties.getProperty("tomcat.port");
+			portSpecifier = properties.getProperty("tomcat.port"); // support for legacy tomcat.port?
+			if(portSpecifier == null) {
+			    portSpecifier = protocolSpecifier.startsWith("https") ? properties.getProperty("tomcat.port.https") : properties.getProperty("tomcat.port.http");
+			}
 			if (portSpecifier == null || portSpecifier.equals("") 
 			    || (protocolSpecifier.equals("http://") && portSpecifier.equals("80"))
