我正在使用svn并尝试通过命令提示符执行结帐操作。这是我的命令svn通过cmd使用java结帐
svn co --username=username --password=password "the url from where I want to checkout" "Path where I want to checkout"
现在按(T)之后运行此命令我得到的输出像
Error validating server certificate for 'https://muurlname':
- 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: PKI
- Valid: from Jul 21 06:11:01 2015 GMT until Jul 21 06:41:01 2017 GMT
- Issuer: PKI
- Fingerprint: FD:9B:96:09:E9:A3:A8:A8:81:78:7E:71:28:FE:BB:93:BF:D0:15:C7
(R)eject, accept (t)emporarily or accept (p)ermanently?
后emporarily或(P)ermanently我的文件结账。
Restored 'D:\Adapters Code SVN\SVN Adapter Test\testfile1.txt'
Restored 'D:\Adapters Code SVN\SVN Adapter Test\checkfile.txt'
Checked out revision 1465.
现在我通过我的java代码执行相同的操作,并通过processbuilder传递命令。但我收到了一些SSL证书验证错误。
svn: E170013: Unable to connect to a repository at URL 'https://myurlname'
svn: E230001: Server SSL certificate verification failed: certificate issued for a different hostname, issuer is not trusted
是否有任何命令在svn我们可以通过用户名和密码,不会给任何SSL证书错误?
这里是我的Java代码来执行结账操作
String url = "https://myWorkingUrl";
String checkoutPath = "D:\\Adapters Code SVN\\SVN Adapter Test";
String command = "svn checkout " + "--trust-server-cert --non-interactive "
+ "--username=hoh7kor --password=emmawatson " + "\"" + url + "\"" + " " + "\"" + checkoutPath + "\"";
ProcessBuilder pb = new ProcessBuilder();
pb.command("cmd.exe", "/c", command);
Process p = pb.start();
p.waitFor();
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
String line2;
while ((line2 = br2.readLine()) != null) {
System.out.println(line2);
}
在执行我收到errorstream输出
svn: E170013: Unable to connect to a repository at URL 'https://myUrl'
svn: E230001: Server SSL certificate verification failed: certificate issued for a different hostname, issuer is not trusted
您是否尝试过使用java库,例如https://svnkit.com/? 证书问题将无法解决,但也许你可以调整客户端来抑制该警告。 – ipper