[ 
https://issues.apache.org/jira/browse/JCRVLT-341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16886760#comment-16886760
 ] 

WalterSteiner commented on JCRVLT-341:
--------------------------------------

[~reschke]

Hi Julian

In the jar there is the class 
"org.apache.jackrabbit.spi2dav.RepositoryServiceImpl" and on line 231 in this 
class, a HttpHost is instanciated. If the schema is not a parameter of the 
constructor, the constructor assumes "http". So the login fails for this url 
"*http*://@host:port". The login-address should be "*https*://@host:port".
{code:java}
try {
 URI repositoryUri = computeRepositoryUri(uri);
 httpHost = new HttpHost(repositoryUri.getHost(), repositoryUri.getPort()*, 
repositoryUri.getScheme()*);

 nsCache = new NamespaceCache();
 uriResolver = new URIResolverImpl(repositoryUri, this, 
DomUtil.createDocument());
 NamePathResolver resolver = new NamePathResolverImpl(nsCache);
 valueFactory = new ValueFactoryQImpl(qValueFactory, resolver);

} catch (URISyntaxException e) {
 throw new RepositoryException(e);
} catch (ParserConfigurationException e) {
 throw new RepositoryException(e);
}{code}
I just added "repositoryUri.getScheme()" on line 231. The original line looked 
like this

httpHost = new HttpHost(repositoryUri.getHost(), repositoryUri.getPort());

The Scheme parameter forces the HttpHost constructor to set the scheme to 
"https" or "http" depending on the value of the parameter. If you use the 
constructor without the scheme parameter, the HttpHost constructor will set the 
scheme to the default value "http".

I hope I could clarify my fix.

Regards

Walter

 

> https doesn't work anymore
> --------------------------
>
>                 Key: JCRVLT-341
>                 URL: https://issues.apache.org/jira/browse/JCRVLT-341
>             Project: Jackrabbit FileVault
>          Issue Type: Bug
>          Components: RCP, vlt
>    Affects Versions: 3.1.44, 3.2.6, 3.2.8
>         Environment: source instance is suse linux sles 12
> target instance is suse linux sles 12 and windows 10
> java 1.8
> AEM 6.4.4
>            Reporter: WalterSteiner
>            Priority: Major
>
> org.apache.jackrabbit.vault.rcp-3.1.24 introduced support of https. I now 
> upgraded to the version 3.2.8. I want to transfer with the following path 
> "/content/etc/robots.txt"  from one aem-author instance to another. I get the 
> following log entry
> 16.07.2019 10:52:52.827 *ERROR* [Vault RCP Task - copy-contentetcrobots.txt] 
> org.apache.jackrabbit.vault.util.RepositoryCopier Error while retrieving src 
> node /content/etc/robots.txt: javax.jcr.PathNotFoundException: 
> /content/etc/robots.txt
> In the source, this path exists. If I do the same with http. The path is 
> found and the content transfered.
> I use the following json to create the tast in aem
> {code}
> {
>  "cmd":"create",
>  "id":"copy-contentetcrobots.txt",
>  
> "src":"https://user:password@host:port/crx/server/crx.default/jcr:root/content/etc/robots.txt";,
>  "dst":"/content/etc/robots.txt",
>  "batchsize": 2048,
>  "update": true,
>  "onlyNewer": true,
>  "recursive": true,
>  "throttle": 1,
>  "excludes": []
> }
> {code}
> Please fix this issue, because we are no longer allowed to use http in our 
> company.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to