]> WPIA git - gigi.git/commitdiff
Search for cert-servers at configured domains.
authorFelix Dörre <felix@dogcraft.de>
Thu, 5 Nov 2015 10:28:36 +0000 (11:28 +0100)
committerFelix Dörre <felix@dogcraft.de>
Thu, 5 Nov 2015 10:28:36 +0000 (11:28 +0100)
src/org/cacert/gigi/dbObjects/CACertificate.java
src/org/cacert/gigi/util/ServerConstants.java

index bdfc6531f564b4479d85c6e366dc0032b335100e..bc900a84b422a4c6137023f1be8ede4cbdc52b13 100644 (file)
@@ -16,6 +16,7 @@ import javax.security.auth.x500.X500Principal;
 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 {
 
@@ -122,10 +123,10 @@ 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`=?");
index 8689209444b1f5199b0d6c29905aa2686d33d362..5ae4e1b320435fbf40f7bce0f020b1d042fcf072 100644 (file)
@@ -14,6 +14,8 @@ public class ServerConstants {
 
     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")) {
@@ -26,6 +28,7 @@ public class ServerConstants {
         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));
 
     }
 
@@ -83,4 +86,8 @@ public class ServerConstants {
         return Integer.parseInt(port.substring(1, port.length()));
     }
 
+    public static String getSuffix() {
+        return suffix;
+    }
+
 }