Spring Cloud Config配置SVN:No valid credentials provided

问题描述

在请求config-server获取SVN资源信息时,总是报下面的错误

org.tmatesoft.svn.core.SVNAuthenticationException: svn: E170001: Negotiate authentication failed: 'No valid credentials provided'
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:62) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.wc.SVNErrorManager.error(SVNErrorManager.java:51) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.http.DefaultHTTPNegotiateAuthentication$1.run(DefaultHTTPNegotiateAuthentication.java:175) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.http.DefaultHTTPNegotiateAuthentication$1.run(DefaultHTTPNegotiateAuthentication.java:166) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.http.DefaultHTTPNegotiateAuthentication.authenticate(DefaultHTTPNegotiateAuthentication.java:221) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:454) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:375) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:363) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.performHttpRequest(DAVConnection.java:710) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.exchangeCapabilities(DAVConnection.java:627) ~[svnkit-1.8.7.jar:na]
    at org.tmatesoft.svn.core.internal.io.dav.DAVConnection.open(DAVConnection.java:102) ~[svnkit-1.8.7.jar:na]

问题原因

在执行下面代码时,不能根据”com.sun.security.jgss.krb5.initiate”找到“No.LoginModules.configured.for.name”,可能是没有找到相应的授权规则,需要调整授权顺序

LoginContext ctx = new LoginContext("com.sun.security.jgss.krb5.initiate", new SVNKitCallbackHandler());

解决方案

起初以为是相关配置的原因,最终从网上找到了解决方法,启动时,增加虚拟机参数,如下:
-Dsvnkit.http.methods=Basic,Digest,Negotiate,NTLM

参考

https://ecosystem.atlassian.net/browse/SVN-435

你可能感兴趣的:(SpringCloud)