svn客户端证书验证缓存

来源:互联网 发布:淘宝 菜鸟驿站 不显示 编辑:程序博客网 时间:2024/05/16 14:35

Made In Zeal 转载请保留原始链接:http://www.zeali.net/entry/554

$ svn list https://host.example.com/repos/project

Error validating server certificate for 'https://host.example.com:443':
 - The certificate is not issued by a trusted authority. Use the
   fingerprint to validate the certificate manually!
 - The certificate hostname does not match.
 - The certificate has expired.
Certificate information:
 - Hostname: host.example.com
 - Valid: from Jan 30 19:23:56 2004 GMT until Jan 30 19:23:56 2006 GMT
 - Issuer: CA, example.com, Sometown, California, US
 - Fingerprint: 7d:e1:a9:34:33:39:ba:6a:e9:a5:c4:22:98:7b:76:5c:92:a0:9c:7b

(R)eject, accept (t)emporarily or accept (p)ermanently?

选择p则在本地保存该证书信息,下次不再出现类似警告。证书缓存保存在 ~/.subversion/auth/svn.ssl.server 目录中。

当 svn 命令行使用了 --no-auth-cache 参数时, (p)ermanently 的选项将不会被显示,只能选择 R 或 t 。但往往有时候会希望对于证书的 validating 可以被本地缓存,但对于用户名密码则不被缓存,这时候可以先不使用 --no-auth-cache 参数运行一次,选择 p 在本地生成缓存文件,同时删除保存在 ~/.subversion/auth/svn.simple 目录下的用户名密码缓存文件,以后就可以使用 --no-auth-cache 参数在每次 svn 的时候都手动输入密码,同时不需要每次都 temporarily 的接受证书了。也可以直接把生成的证书缓存文件直接复制到其他的机器相应的用户目录下。

网上会有很多文章说可以通过在 ~/.subversion/servers 配置文件中 加上

ssl-ignore-host-mismatch = true

ssl-ignore-unknown-ca = true

ssl-ignore-invalid-date = true 

来让svn自动忽略证书错误,但实际上这些配置项在新版的 subversion 里面已经被 deprecated 掉了。
 

原创粉丝点击