[
https://issues.apache.org/jira/browse/IVY-1234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maarten Coene resolved IVY-1234.
--------------------------------
Assignee: Maarten Coene
Fix Version/s: trunk
Resolution: Fixed
Hi,
thanks for the patch. I think the problem is more general in a way that Ivy
could not authenticate against any site having the same address as the proxy
server.
Your patch solves only the case where the proxy server is anonymous, not the
case where the proxy requires authentication and the site (on the same machine
as the proxy) requires authentication as well (which is different from the
proxy authentication)
I've committed another patch in SVN trunk which I believe should fix the
problem.
Unfortunately, I don't a proxy server to test with, so could you give it a try
to see if it solves your problem and post your feedback here?
thanks,
Maarten
> Ivy fails to publish to remote repository IF a proxy is set and the proxy has
> NO credential requirements.
> ---------------------------------------------------------------------------------------------------------
>
> Key: IVY-1234
> URL: https://issues.apache.org/jira/browse/IVY-1234
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.2.0-RC1
> Environment: Snow Leopard 10.6.4 running Squid 3.0 and Artifactory
> 2.2.5
> Reporter: David Harrigan
> Assignee: Maarten Coene
> Priority: Critical
> Fix For: trunk
>
> Attachments: IVY-1234.patch
>
>
> I've just come across this problem and I believe it's critical. I've searched
> on JIRA for similar issues and I can't find anything.
> I have this configured in my ivysettings.xml:
> {code:xml|title=ivysettings.xml|borderStyle=solid}
> <credentials host="localhost" realm="Artifactory Realm" username="admin"
> passwd="password"/>
> {code}
> Which is the default credentials for Artifactory 2.2.5.
> I have this resolver as a remote:
> {code:xml|title=ivysettings.xml|borderStyle=solid}
> <url name="artifactory-snapshots">
> <ivy
> pattern="http://localhost:8081/artifactory/libs-snapshots-local/[organisation]/[module]/[revision]/ivy-[revision].xml"
> />
> <artifact
> pattern="http://localhost:8081/artifactory/libs-snapshots-local/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
> />
> </url>
> {code}
> Whenever I attempt to publish, Ivy is reporting this issue:
> {code:xml|title=build.xml|borderStyle=solid}
> BUILD FAILED
> /Users/david/development/tmp/ant/includes/ivy.xml:25: impossible to publish
> artifacts for com.as#xmltransformer;0.1.0-SNAPSHOT: java.io.IOException:
> Access to URL
> http://localhost:8081/artifactory/libs-snapshots-local/com.as/xmltransformer/0.1.0-SNAPSHOT/xmltransformer-0.1.0-SNAPSHOT.jar
> was refused by the server: User anonymous is not permitted to deploy
> 'com.as/xmltransformer/0.1.0-SNAPSHOT/xmltransformer-0.1.0-SNAPSHOT.jar' into
> 'libs-snapshots-local:com.as/xmltransformer/0.1.0-SNAPSHOT/xmltransformer-0.1.0-SNAPSHOT.jar'.
> at
> org.apache.ivy.util.url.AbstractURLHandler.validatePutStatusCode(AbstractURLHandler.java:79)
> at
> org.apache.ivy.util.url.BasicURLHandler.upload(BasicURLHandler.java:225)
> at
> org.apache.ivy.util.url.URLHandlerDispatcher.upload(URLHandlerDispatcher.java:82)
> at org.apache.ivy.util.FileUtil.copy(FileUtil.java:148)
> at
> org.apache.ivy.plugins.repository.url.URLRepository.put(URLRepository.java:84)
> at
> org.apache.ivy.plugins.repository.AbstractRepository.put(AbstractRepository.java:130)
> at
> org.apache.ivy.plugins.resolver.RepositoryResolver.put(RepositoryResolver.java:234)
> at
> org.apache.ivy.plugins.resolver.RepositoryResolver.publish(RepositoryResolver.java:216)
> at
> org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:281)
> at
> org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:260)
> at
> org.apache.ivy.core.publish.PublishEngine.publish(PublishEngine.java:172)
> at org.apache.ivy.Ivy.publish(Ivy.java:600)
> at org.apache.ivy.ant.IvyPublish.doExecute(IvyPublish.java:311)
> at org.apache.ivy.ant.IvyTask.execute(IvyTask.java:277)
> at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
> at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
> at org.apache.tools.ant.Task.perform(Task.java:348)
> at org.apache.tools.ant.Target.execute(Target.java:390)
> at org.apache.tools.ant.Target.performTasks(Target.java:411)
> at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1397)
> at org.apache.tools.ant.Project.executeTarget(Project.java:1366)
> at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
> at org.apache.tools.ant.Project.executeTargets(Project.java:1249)
> at org.apache.tools.ant.Main.runBuild(Main.java:801)
> at org.apache.tools.ant.Main.startAnt(Main.java:218)
> at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
> at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
> {code}
> Notice how it is attempting to publish using anonymous credentials.
> I am running squid 3.0 on my machine to speed up internet access, but it is
> an anonymous proxy - there is no username or password required.
> Looking at the latest source from svn, in IvyAuthenticator:
> {code:title=IvyAuthenticator.java|borderStyle=solid}
> String proxyHost = System.getProperty("http.proxyHost");
> if (getRequestingHost().equals(proxyHost)) {
> String proxyUser = System.getProperty("http.proxyUser");
> if ((proxyUser != null) && (proxyUser.trim().length() > 0)) {
> String proxyPass = System.getProperty("http.proxyPassword",
> "");
> Message.debug("authenicating to proxy server with username ["
> + proxyUser + "]");
> result = new PasswordAuthentication(proxyUser,
> proxyPass.toCharArray());
> }
> } else {
> Credentials c =
> CredentialsStore.INSTANCE.getCredentials(getRequestingPrompt(),
> getRequestingHost());
> Message.debug("authentication: k='"
> + Credentials.buildKey(getRequestingPrompt(),
> getRequestingHost()) + "' c='" + c
> + "'");
> if (c != null) {
> result = new PasswordAuthentication(c.getUserName(),
> c.getPasswd().toCharArray());
> }
> }
> {code}
> What appears to be happening is that the requesting host == localhost, it
> attempts to get the proxy user, which is subsequently null, it then
> *completely* skips over the attempt at line 91 (Credentials c = ...) to
> retrieve the configured credentials, thus it then attempts to log in
> anonymously which fails...
> I believe anyone running a proxy on their machine (or more seriously I
> suppose if their company has an anonymous proxy between the developer/build
> machine and the repository) then as it stands currently, any attempts to
> publish will fail.
> If I can be of any further assistance, please do let me know.
> -=david=-
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.