String proto = httpFields.getStringField("X-Real-Proto");
String cert = httpFields.getStringField("X-Client-Cert");
request.setSecure("https".equals(proto));
- System.out.println(request.isSecure());
request.setScheme(proto);
if ( !"https".equals(proto)) {
cert = null;
}
public static byte[] decode(String type, String data) {
- data = data.replaceAll("-----BEGIN " + type + "-----", "").replace("\n", "").replace("\r", "");
+ data = data.replaceAll("-----BEGIN " + type + "-----", "");
// Remove the first and last lines
data = data.replaceAll("-----END " + type + "-----", "");
+ data = data.replace("\n", "").replace("\r", "").replace(" ", "").replace("\t", "");
// Base64 decode the data
return Base64.getDecoder().decode(data);