Changeset 32418 for main/trunk
- Timestamp:
- 2018-09-03T15:21:46+12:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/util/ProtocolPortProperties.java
r32358 r32418 77 77 78 78 // We could either be dealing with properties files from before https support was introduced, in which case we want to be backwards compatible 79 // Or we're dealing with properties files after https support was introduced. 79 // Or we're dealing with properties files after https support was introduced. 80 80 // To determine which, can ignore server.protocol: server.protocol was introduced at a time when tomcat.port was still in effect, 81 // server.protocol's presence does not indicate whether our GS3 installation supports https or not. Only the tomcat.port property 82 // indicates that: if tomcat.port exists it's an older GS3 that has no https support, so default to http. If there is no tomcat.port, 83 // but there is a server.protocol check for the newer tomcat.port.<protocol> properties. 84 85 if(port != null) { // tomcat.port exists, so this is a GS3 before https support. 81 // server.protocol's presence does not indicate whether our GS3 installation supports https or not. Only the tomcat.port properties 82 // indicates that: if tomcat.port exists BUT tomcat.port.http(s) don't, then it's an older GS3 that has no https support, so default to http. 83 // If there is no tomcat.port at all, but there is a server.protocol check for the newer tomcat.port.<protocol> properties. 84 // NOTE: global.properties still has a property called tomcat.port. We're only dealing with the old tomcat.port-only way if tomcat.port.http(s) don't exist 85 86 if(props.getProperty("tomcat.port.http") == null && props.getProperty("tomcat.port.https") == null && port != null) { 87 // tomcat.port exists but tomcat.port.http(s) don't, so this is a GS3 before https support. 86 88 legacyMode = true; 87 89 88 // Back when tomcat.port was used , server.protocol if specified90 // Back when tomcat.port was used AND tomcat.port.http(s) didn't exist, server.protocol if specified 89 91 // would always be treated as http regardless of what it was set to 90 protocol = defProtocol; 91 92 93 protocol = defProtocol; // tomcat.port.http(s) doesn't exist, just use http 94 95 92 96 if(port.equals("")) { 93 97 errorCode = OLD_TOMCATPORT_BUT_NO_VALUE; … … 96 100 port = httpPort = defHttpPort; 97 101 } 98 } else { // No issu s: using tomcat.port is the pre-https way.102 } else { // No issues: using tomcat.port is the pre-https way. 99 103 errorCode = ALL_CORRECT; 100 104 httpPort = port; … … 106 110 protocol = props.getProperty("server.protocol"); 107 111 if(protocol == null || (!protocol.equals("http") && !protocol.equals("https"))) { 108 // tomcat.port was null AND now server.protocol is null or wrong. Something very wrong with the properties file 109 if(protocol == null) { 112 if(port == null) { // if tomcat.port is null AND server.protocol is null or wrong. Something very wrong with the properties file 113 errorCode = NO_PROTOCOL_OR_PORT; 114 msg.append("server.protocol not set. And can't determine port."); 115 } else if(protocol == null) { 110 116 errorCode = NO_PROTOCOL_OR_PORT; 111 msg.append("server.protocol not set. And can't determine port.");117 msg.append("server.protocol not set."); 112 118 } else { 113 119 errorCode = INVALID_PROTOCOL;
Note:
See TracChangeset
for help on using the changeset viewer.