Return-Path: X-Original-To: apmail-ant-notifications-archive@minotaur.apache.org Delivered-To: apmail-ant-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B846911076 for ; Sat, 12 Jul 2014 05:22:22 +0000 (UTC) Received: (qmail 10548 invoked by uid 500); 12 Jul 2014 05:22:22 -0000 Delivered-To: apmail-ant-notifications-archive@ant.apache.org Received: (qmail 10508 invoked by uid 500); 12 Jul 2014 05:22:22 -0000 Mailing-List: contact notifications-help@ant.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ant.apache.org Delivered-To: mailing list notifications@ant.apache.org Received: (qmail 10499 invoked by uid 99); 12 Jul 2014 05:22:22 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 12 Jul 2014 05:22:22 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id AA4458B7731; Sat, 12 Jul 2014 05:22:21 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bodewig@apache.org To: notifications@ant.apache.org Message-Id: <0b183cffaa384c0db2e38a12b7b1edd0@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: PR 56678 allow tsa proxy host to be used without tsaurl in signjar Date: Sat, 12 Jul 2014 05:22:21 +0000 (UTC) Repository: ant Updated Branches: refs/heads/master 37a64a407 -> ba170891d PR 56678 allow tsa proxy host to be used without tsaurl in signjar Project: http://git-wip-us.apache.org/repos/asf/ant/repo Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/ba170891 Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/ba170891 Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/ba170891 Branch: refs/heads/master Commit: ba170891db5e5a75d02391a73085dee6e7a6074d Parents: 37a64a4 Author: Stefan Bodewig Authored: Sat Jul 12 07:21:55 2014 +0200 Committer: Stefan Bodewig Committed: Sat Jul 12 07:21:55 2014 +0200 ---------------------------------------------------------------------- .../org/apache/tools/ant/taskdefs/SignJar.java | 31 ++++++++++---------- 1 file changed, 16 insertions(+), 15 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ant/blob/ba170891/src/main/org/apache/tools/ant/taskdefs/SignJar.java ---------------------------------------------------------------------- diff --git a/src/main/org/apache/tools/ant/taskdefs/SignJar.java b/src/main/org/apache/tools/ant/taskdefs/SignJar.java index a15df4f..f971001 100644 --- a/src/main/org/apache/tools/ant/taskdefs/SignJar.java +++ b/src/main/org/apache/tools/ant/taskdefs/SignJar.java @@ -549,21 +549,6 @@ public class SignJar extends AbstractJarSignerTask { if (tsaurl != null) { addValue(cmd, "-tsa"); addValue(cmd, tsaurl); - - if (tsaproxyhost != null) { - final String connectionType; - if (tsaurl.startsWith("https")) { - connectionType = "https"; - } else { - connectionType = "http"; - } - - addValue(cmd, "-J-D" + connectionType + ".proxyHost=" + tsaproxyhost); - - if (tsaproxyport != null) { - addValue(cmd, "-J-D" + connectionType + ".proxyPort=" + tsaproxyport); - } - } } if (tsacert != null) { @@ -571,6 +556,14 @@ public class SignJar extends AbstractJarSignerTask { addValue(cmd, tsacert); } + if (tsaproxyhost != null) { + if (tsaurl == null || tsaurl.startsWith("https")) { + addProxyFor(cmd, "https"); + } + if (tsaurl == null || !tsaurl.startsWith("https")) { + addProxyFor(cmd, "http"); + } + } } /** @@ -641,4 +634,12 @@ public class SignJar extends AbstractJarSignerTask { public void setPreserveLastModified(boolean preserveLastModified) { this.preserveLastModified = preserveLastModified; } + + private void addProxyFor(final ExecTask cmd, final String scheme) { + addValue(cmd, "-J-D" + scheme + ".proxyHost=" + tsaproxyhost); + + if (tsaproxyport != null) { + addValue(cmd, "-J-D" + scheme + ".proxyPort=" + tsaproxyport); + } + } }