>我有一台服务器运行apache,带有自签名证书(服务器),并附带了subversion
>它需要用户名来结帐或从repo更新.
>我有一个来自repo的结账,我试图在两台服务器上的cron作业上更新:服务器和客户端.这两个cron作业都不会出于同样的原因(我在两者上的设置几乎相同,但客户端更简单).
>以下是客户端,其中只有一个登录:root(我知道,请饶恕我的嘲笑)
>如果你认为重要,他们都是gentoo
>它需要用户名来结帐或从repo更新.
>我有一个来自repo的结账,我试图在两台服务器上的cron作业上更新:服务器和客户端.这两个cron作业都不会出于同样的原因(我在两者上的设置几乎相同,但客户端更简单).
>以下是客户端,其中只有一个登录:root(我知道,请饶恕我的嘲笑)
>如果你认为重要,他们都是gentoo
Error validating server certificate for 'https://server:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! - The certificate hostname does not match. Certificate information: - Hostname: Tom - Valid: from Sun,01 Feb 2009 03:51:25 GMT until Tue,01 Feb 2011 03:51:25 GMT - Issuer: Fake Company,NYC,New York,US - Fingerprint: fingerprint here (R)eject,accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://server/svn/repo': Server certificate verification Failed: certificate issued for a different hostname,issuer is not trusted (https://server)
我知道这一切.这就是我遵循所有指南让svn自动接受证书的原因:
/root/.subversion/servers
[global] ssl-authority-files = /root/scripts/server.crt
/root/scripts/server.crt
-----BEGIN CERTIFICATE----- MIIDejCCAmICCQDibo0twimetjANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJV UzERMA8GA1UECBMITmV3IFlvcmsxDDAKBgNVBAcTA05ZQzEjMCEGA1UEChMaSGFw et al -----END CERTIFICATE-----
/root/scripts/backup.sh
svn up /BACKUP/checkouts/server/ --username tom
并且命令以root身份运行(没有sudo,直接以root身份运行),没有提示确认证书(之前有过,但我选择了p永久接受).
有谁知道为什么我的脚本不起作用?在过去的几个月里,我一直很讨厌.
**编辑:**我花了一点时间回到这里,我遵循了大卫的建议,但它仍然无效.现在的错误是:
Error validating server certificate for 'https://server:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! Certificate information: - Hostname: server - Valid: from Sat,20 Jun 2009 14:10:45 GMT until Mon,20 Jun 2011 14:10:45 GMT - Issuer: Fake Company,US - Fingerprint: 1a:c6:9c:eb:62:9e:e1:05:d9:d3:ac:01:f4:35:dc:00:14:48:e5:39 (R)eject,accept (t)emporarily or accept (p)ermanently? svn: OPTIONS of 'https://server/svn/folder': Server certificate verification Failed: issuer is not trusted (https://server)
解决方法
Error validating server certificate for 'https://server:443': - The certificate is not issued by a trusted authority. Use the fingerprint to validate the certificate manually! - The certificate hostname does not match. Certificate information: - Hostname: Tom - Valid: from Sun,US - Fingerprint: fingerprint here
问题是您的证书与服务器的主机名不匹配.您需要证书中的CN字段以匹配您的主机名.在您的情况下,您的主机名是“服务器”,而您的证书的CN是“Tom”.您需要使用正确的CN值重新生成证书.