且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jenkins中的SVN命令行由于服务器证书不匹配而失败

更新时间:2022-11-12 23:04:27

相当老的问题,但仍然很生动.

Pretty old question, but still quite alive.

您知道,问题在于接受的证书高速缓存(以及用户名/密码高速缓存)是按用户使用的,并且由于Jenkins以不同的用户身份运行(很可能是SYSTEM),因此它不知道您的常规用户缓存.

As you know, the problem is that the accepted certificate cache (as well as the username/password cache) is per-user, and since Jenkins is running as a different user (most likely SYSTEM), it has no idea of your regular user cache.

并非所有SVN客户端都允许您在此处执行回显p"操作(这对我不起作用),并且--trust-server-cert在这种情况下显然也不起作用.

Not all SVN clients let you do the "echo p" thing there (it didn't work for me), and the --trust-server-cert apparently doesn't work in this case either.

对我有用的是

What worked for me was to open a console window as SYSTEM, and do the interactive acceptcertificate-login-password dance in there.

由于所有这些都已缓存,因此只需要执行一次,然后所有svn up和类似请求都将起作用.

Since all of this is cached, you only need to do this once, and from then on, all svn up and similar requests will work.