import org.cacert.gigi.database.DatabaseConnection;
import org.cacert.gigi.database.GigiPreparedStatement;
import org.cacert.gigi.database.GigiResultSet;
+import org.cacert.gigi.util.ServerConstants;
public class CACertificate implements IdCachable {
String link;
String keyname = names.get(subj);
if ( !keyname.contains("_")) {
- link = "http://g2.crt.cacert.org/g2/" + keyname + ".crt";
+ link = "http://g2.crt." + ServerConstants.getSuffix() + "/g2/" + keyname + ".crt";
} else {
String[] parts = keyname.split("_");
- link = "http://g2.crt.cacert.org/g2/" + parts[1] + "/" + parts[0] + "-" + parts[2] + ".crt";
+ link = "http://g2.crt." + ServerConstants.getSuffix() + "/g2/" + parts[1] + "/" + parts[0] + "-" + parts[2] + ".crt";
}
GigiPreparedStatement q2 = DatabaseConnection.getInstance().prepare("INSERT INTO `cacerts` SET `parentRoot`=?, `keyname`=?, `link`=?");
private static String securePort, port;
+ private static String suffix = "cacert.local";
+
public static void init(Properties conf) {
securePort = port = "";
if ( !conf.getProperty("https.port").equals("443")) {
secureHostName = conf.getProperty("name.secure");
staticHostName = conf.getProperty("name.static");
apiHostName = conf.getProperty("name.api");
+ suffix = conf.getProperty("name.suffix", conf.getProperty("name.www").substring(4));
}
return Integer.parseInt(port.substring(1, port.length()));
}
+ public static String getSuffix() {
+ return suffix;
+ }
+
}