diff --git a/apps/i2ptunnel/jsp/ssl.jsp b/apps/i2ptunnel/jsp/ssl.jsp
index 55cbc29393be0df456f6213a2b5ff9613c63195a..2ed874f8f411d01fbe012172b8e003744ba03c32 100644
--- a/apps/i2ptunnel/jsp/ssl.jsp
+++ b/apps/i2ptunnel/jsp/ssl.jsp
@@ -199,8 +199,11 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
                             ks.delete();
                     }
                     try {
+                        boolean haveEC = net.i2p.crypto.SigType.ECDSA_SHA256_P256.isAvailable();
+                        String alg = haveEC ? "EC" : "RSA";
+                        int sz = haveEC ? 256 : 2048;
                         Object[] rv = net.i2p.crypto.KeyStoreUtil.createKeysAndCRL(ks, kspw, "eepsite", name, altNames, b32,
-                                                                                   3652, "EC", 256, newpw);
+                                                                                   3652, alg, sz, newpw);
                         msgs.append("Created selfsigned cert\n");
                         // save cert
                         java.security.cert.X509Certificate cert = (java.security.cert.X509Certificate) rv[2];