diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/SSLHelper.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/SSLHelper.java new file mode 100644 index 000000000..39754503f --- /dev/null +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/SSLHelper.java @@ -0,0 +1,60 @@ +package net.i2p.i2ptunnel.web; + +import java.util.ArrayList; +import java.util.List; + +/** + * Helper class for ssl.jsp + * + * @since 0.9.35 + */ +public class SSLHelper { + + /** + * Adapted from LoadClientAppsJob + * @return param args non-null + * @return non-null + */ + public static List parseArgs(String args) { + List argList = new ArrayList(4); + StringBuilder buf = new StringBuilder(32); + boolean isQuoted = false; + for (int j = 0; j < args.length(); j++) { + char c = args.charAt(j); + switch (c) { + case '\'': + case '"': + if (isQuoted) { + String str = buf.toString().trim(); + if (str.length() > 0) + argList.add(str); + buf.setLength(0); + } + isQuoted = !isQuoted; + break; + case ' ': + case '\t': + // whitespace - if we're in a quoted section, keep this as part of the quote, + // otherwise use it as a delim + if (isQuoted) { + buf.append(c); + } else { + String str = buf.toString().trim(); + if (str.length() > 0) + argList.add(str); + buf.setLength(0); + } + break; + default: + buf.append(c); + break; + } + } + if (buf.length() > 0) { + String str = buf.toString().trim(); + if (str.length() > 0) + argList.add(str); + } + return argList; + } +} diff --git a/apps/i2ptunnel/jsp/ssl.jsp b/apps/i2ptunnel/jsp/ssl.jsp index 5d10a42cf..40abbfab5 100644 --- a/apps/i2ptunnel/jsp/ssl.jsp +++ b/apps/i2ptunnel/jsp/ssl.jsp @@ -99,16 +99,14 @@ input.default { width: 1px; height: 1px; visibility: hidden; } if (name == null || name.equals("")) name = editBean.getTunnelName(curTunnel); -%> - - - - -<% if (!"new".equals(tunnelType)) { %> -
+ + + + + @@ -374,6 +372,14 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% } // isPWDefault +%> + + +<% } // canConfigure } // for client } catch (java.io.IOException ioe) { ioe.printStackTrace(); }
<%=intl._t("Experts only!")%> Beta!
<%=intl._t("Tunnel name")%>: <%=editBean.getTunnelName(curTunnel)%>
Jetty SSL cert passwords are not the default
<%=intl._t("Password")%>: +" value="" class="freetext password" /> +
+ +