aboutsummaryrefslogtreecommitdiff
path: root/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java
diff options
context:
space:
mode:
Diffstat (limited to 'id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java')
-rw-r--r--id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java b/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java
index bd64b5a42..9bdf8a20e 100644
--- a/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java
+++ b/id.server/src/at/gv/egovernment/moa/id/util/SSLUtils.java
@@ -21,6 +21,7 @@ import java.util.Map;
import javax.net.ssl.SSLSocketFactory;
import org.apache.regexp.RE;
+import org.apache.regexp.RESyntaxException;
import at.gv.egovernment.moa.id.config.ConfigurationException;
import at.gv.egovernment.moa.id.config.ConfigurationProvider;
@@ -153,13 +154,17 @@ public class SSLUtils {
conn.setSSLSocketFactory(sslSocketFactory);
conn.connect();
String contentType = conn.getContentType();
- RE regExp = new RE("(;.*charset=)(\"*)(.*[^\"])");
+ RE regExp = null;
+ try {
+ regExp = new RE("(;.*charset=)(\"*)(.*[^\"])");
+ } catch (RESyntaxException e) {
+ //RESyntaxException is not possible = expr. is costant
+ }
boolean charsetSupplied = regExp.match(contentType);
String encoding = "ISO-8859-1"; //default HTTP encoding
if (charsetSupplied) {
encoding = regExp.getParen(3);
}
- //TODO RS TEST if this works on other platforms
InputStream instream = new BufferedInputStream(conn.getInputStream());
InputStreamReader isr = new InputStreamReader(instream, encoding);
Reader in = new BufferedReader(isr);