I cannot get Jarsigner to use HTTPS Proxy. For my system I have configured the http & https proxy in /etc/sysconfig/proxy. I have even added proxy in Java Control.
Checking with wget and the proxy does work:
user@machineLinx:~/workspace/myApp> wget https://timestamp.geotrust.com/tsa
--2015-10-05 16:06:30-- https://timestamp.geotrust.com/tsa
Resolving proxy.spacetec.no... 100.11.4.6
Connecting to proxy.spacetec.no|100.11.4.6|:3128... connected.
Proxy request sent, awaiting response... 404 Not Found
2015-10-05 16:06:31 ERROR 404: Not Found.
Using Jarsigner does not use the provided Proxy:
/usr/java/jdk1.7.0_80/bin/jarsigner -J-Dhttps.proxyHost=http://proxy.company.com -J-Dhttps.proxyPort=3128 -keystore /home/user/keystore.p12 -storepass myStorePass -storetype pkcs12 -tsa https://timestamp.geotrust.com/tsa workspace/myApp/target/myApp-1.0.0-SNAPSHOT.jar alias
jarsigner: unable to sign jar: no response from the Timestamping Authority. When connecting from behind a firewall an HTTP or HTTPS proxy may need to be specified. Supply the following options to jarsigner:
-J-Dhttp.proxyHost=<hostname>
-J-Dhttp.proxyPort=<portnumber>
or
-J-Dhttps.proxyHost=<hostname>
-J-Dhttps.proxyPort=<portnumber>
So why is the proxy working on my system, but not with Java? I have tried with both jdk1.7.0_80 and jdk1.8.0_60
jarsigner communicates with the TSA using the Time-Stamp Protocol (TSP) defined in RFC 3161. The protocol basically assumes a listener process on a TSA that can accept TSA messages on a well-defined port (IP port number 318).
Could it be that my Proxy does not communicate with this port for TSP?