Bug 57197: use proxy for TestSignatureInfo if set via environment variables

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1637979 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Dominik Stadler 2014-11-10 20:37:26 +00:00
parent 3cf7699fde
commit 9f3e8b4919
2 changed files with 10 additions and 2 deletions

View File

@ -86,7 +86,8 @@ under the License.
<property name="poi.test.locale" value="-Duser.language=en -Duser.country=US"/>
<property name="POI.testdata.path" value="test-data"/>
<property name="java.awt.headless" value="true"/>
<property name="additionaljar" value=""/>
<property name="additionaljar" value=""/>
<property name="http_proxy" value="${env.http_proxy}"/>
<!-- Main: -->
<property name="main.resource1.dir" value="src/resources/main"/>
@ -227,6 +228,7 @@ under the License.
<propertyref name="POI.testdata.path"/>
<propertyref name="java.awt.headless"/>
<propertyref name="org.apache.poi.util.POILogger"/>
<propertyref name="http_proxy"/>
</propertyset>
<path id="main.classpath">

View File

@ -310,6 +310,12 @@ public class TestSignatureInfo {
signatureConfig.setTspRequestPolicy(null); // comodoca request fails, if default policy is set ...
signatureConfig.setTspOldProtocol(false);
//set proxy info if any
String proxy = System.getProperty("http_proxy");
if (proxy != null && proxy.trim().length() > 0) {
signatureConfig.setProxyUrl(proxy);
}
if (mockTsp) {
TimeStampService tspService = new TimeStampService(){
@Override