Skip to content
This repository was archived by the owner on Oct 27, 2019. It is now read-only.

Commit

Permalink
Fix non-SSL problems (need sleep...)
Browse files Browse the repository at this point in the history
  • Loading branch information
milgner committed Mar 4, 2014
1 parent bf071cc commit 397de69
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -64,17 +64,15 @@ public IssueData fetch() {
private InputStream fetchUrlWithRedmineHeader(String _url) throws IOException {
try {
HttpClient httpClient = new HttpClient();
org.apache.commons.httpclient.HttpURL url;
if (_url.toLowerCase().startsWith("https:")) {
url = new HttpsURL(_url);
if (ignoreSSL) {
Protocol easyhttps = new Protocol("https", new org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory(), url.getPort());
httpClient.getHostConfiguration().setHost(url.getHost(), url.getPort(), easyhttps);
}
HttpMethod httpMethod = null;
if (_url.toLowerCase().startsWith("https:") && ignoreSSL) {
HttpsURL url = new HttpsURL(_url);
Protocol easyhttps = new Protocol("https", new org.apache.commons.httpclient.contrib.ssl.EasySSLProtocolSocketFactory(), url.getPort());
httpClient.getHostConfiguration().setHost(url.getHost(), url.getPort(), easyhttps);
httpMethod = new GetMethod(url.getPath());
} else {
url = new HttpURL(_url);
httpMethod = new GetMethod(_url);
}
HttpMethod httpMethod = new GetMethod(url.getPath());
httpMethod.setRequestHeader("X-Redmine-API-Key", apiToken);
httpClient.executeMethod(httpMethod);
return httpMethod.getResponseBodyAsStream();

0 comments on commit 397de69

Please # to comment.