替代Authenticode的时间戳服务

我们为所有生产版本执行代码签名和时间戳。 偶尔(通常在我们即将RTM(!))Verisign的时间戳服务器(“ http://timestamp.verisign.com/scripts/timstamp.dll ”)决定间歇性地离线。

在这种情况下我们应该做什么?

  • 时间戳服务器是否必须由您的根证书颁发机构托pipe?
  • 如果服务器出现故障,我们可以使用其他networking托pipe的时间戳服务器而不是Verisign吗? 其他高可用和免费的替代scheme的build议,欢迎:)

我使用以下batch file循环最多300次。 有两个参数,%1是包含batch file,pfx文件和signtool.exe的文件夹的path。 %2是正在签名的文件的完整path。 你可以在你的Visual Studio后期构build事件中调用类似于调用“$(SolutionDir)thirdparty \ signing \ sign.bat”“$(SolutionDir)thirdparty \ signing”“$(TargetPath)”的方法来调用此batch file在每个迭代中使用不同的时间戳服务器。 目前它使用Comodo,Verisign,GlobalSign和Starfield。 希望这是最终的签名脚本;)

@echo off REM create an array of timestamp servers... set SERVERLIST=(http://timestamp.comodoca.com/authenticode http://timestamp.verisign.com/scripts/timestamp.dll http://timestamp.globalsign.com/scripts/timestamp.dll http://tsa.starfieldtech.com) REM sign the file... %1\signtool.exe sign /f %1\comodo.pfx /p videodigital %2 set timestampErrors=0 for /L %%a in (1,1,300) do ( for %%s in %SERVERLIST% do ( REM try to timestamp the file. This operation is unreliable and may need to be repeated... %1\signtool.exe timestamp /t %%s %2 REM check the return value of the timestamping operation and retry a max of ten times... if ERRORLEVEL 0 if not ERRORLEVEL 1 GOTO succeeded echo Signing failed. Probably cannot find the timestamp server at %%s set /a timestampErrors+=1 ) REM wait 2 seconds... choice /N /T:2 /D:Y >NUL ) REM return an error code... echo sign.bat exit code is 1. There were %timestampErrors% timestamping errors. exit /b 1 :succeeded REM return a successful code... echo sign.bat exit code is 0. There were %timestampErrors% timestamping errors. exit /b 0 

我也把http://timestamp.comodoca.com放入受信任的网站(感谢Vince)。; 我认为这可能是一个重要的步骤。 我也更新了PC上的根证书。

我不确定时间戳服务器是否必须由根CA拥有。

我们使用http://timestamp.comodoca.com/authenticode (并有一个Comodo authenticode证书),但实际上有一个类似的问题,因为他们的服务器似乎给偶尔错误或超时。 我们的签署是作为夜间(或按需)构build的一部分,只在版本构build的持续集成服务器(而不是构build版本)上进行。

我以两种方式解决了这个问题(大部分):

  • 如果对signtool.exe的调用失败,则会再次(立即)再次尝试两次
  • 用于在一个步骤中签​​署每个exe的构build脚本(我们有几个作为我们的产品的一部分),现在它一个接一个地执行 – 花费更长的时间,但不太可能失败

在这些之间,由时间戳服务器问题引起的构build失败已经从一周一次或两次发生到几乎从不发生。

编辑:我有一个MSBuild任务这样做(以及读取存储在存储库外的证书密码 )在https://gist.github.com/gregmac/4cfacea5aaf702365724

它可以很好地工作,通过以下之一replaceverisign时间戳url:

http://timestamp.comodoca.com/authenticode
http://www.trustcenter.de/codesigning/timestamp

任何时间戳服务器都可以使用:我最近从发行者的时间戳服务器切换到Verisign,因为我发现GlobalSign的服务器是不可靠的。 此外,Thawte不运行自己的时间戳服务器,但build议人们使用Verisign的。

威瑞信时间戳服务是免费的。 这也许可能是为什么它的可靠性不足够; 他们不给它一个维护预算!

这绝对是一个问题。 由于代码时间戳失败而造成的时间浪费是整个软件开发行业日益增长的问题。 当然,你可以写一个复杂的脚本来旋转,直到你find一个工作时间标记服务器..但是,真的吗?

我们应该要求更好。 我们支付这些证书的一个LOT。

请注意,后来我发现在Verisign和Comodoclosures期间(通常在工作日的工作时间发生的情况下),很less有人听说过可以使用的备用时间戳服务器。

我有同样的问题。 verisign服务器有时无法访问我试图签名的文件(但同一个版本中的其他文件被正确签名)。

我通常会重试,但它的工作,但今天,没办法。

所以在互联网上的一些unusefull研究后,我试图把http://*.verisign.com放在信任的区域网站,它的工作原理…最后我不知道如果服务器有问题,现在可以工作,或者如果我做了对的事情,我会觉得在接下来的日子里会看到。 希望它可以帮助其他被阻止。

服务器configuration:Windows Server 2003 SP2,IE8,增强安全性。