Bug 68551

Summary: CMIS checkout URL broken when using https
Product: LibreOffice Reporter: florent
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED WORKSFORME    
Severity: major CC: barta, cedric.bosdonnat.ooo, serval2412
Priority: medium    
Version: 4.1.0.4 release   
Hardware: All   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=73417
Whiteboard:
Crash report or crash signature: Regression By:

Description florent 2013-08-25 23:10:29 UTC
When using LibreOffice to connect to an HTTPS server through CMIS, LibreOffice incorrectly uses an http URL when trying to check out a document.

For example, when using the binding URL 'https://alfresco-internal.example.com/alfresco/cmisatom', browsing the repository and opening a document works perfectly, but when clicking "check out" the following errors appear in the log:

http://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:1: parser error : Space required after the Public Identifier
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
                                                 ^
http://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:1: parser error : SystemLiteral " or ' expected
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
                                                 ^
http://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:1: parser error : SYSTEM or PUBLIC, the URI is missing
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
                                                 ^
http://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:9: parser error : Opening and ending tag mismatch: hr line 7 and body
</body></html>
       ^
http://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:9: parser error : Opening and ending tag mismatch: body line 4 and html
</body></html>
              ^
http://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:10: parser error : Premature end of data in tag html line 2

^



Which is consistent with hitting the HTTP URL with curl:

[10:18:44]florent@ubuntu:~/ $ curl http://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:10
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://alfresco-internal.example.com/alfresco/cmisatom/09d6f8b9-38cc-11dd-9df2-4f7a305b5205/checkedout?objectId=workspace%3A%2F%2FSpacesStore%2F8109dd63-6982-4031-a733-11ea9e19c921%3B0.2:10">here</a>.</p>
<hr>
<address>Apache/2.2.22 (Ubuntu) Server at alfresco-internal.example.com Port 80</address>
</body></html>


(We have an Apache rule to redirect http requests to https.)


The correct fix would be to use the provided URL when checking out the document, but a workaround could be to follow the 301 Redirect when doing the request.

Regards,
Florent
Comment 1 Julien Nabet 2013-08-30 05:15:48 UTC
Cédric: I haven't tested but I think you might be interested in this one.
Comment 2 Boriss Mejias 2013-11-28 14:00:05 UTC
Hi Florent,

We had a similar issue that is fixed now. It might also help your problem. You need to add a configuration for the spring webscripts on Alfresco. More details on the following links:

https://issues.alfresco.com/jira/browse/MOBILE-42
http://tech.wrighting.org/category/cmis/

Basically, you need to add the following to
tomcat/shared/classes/META-INF/spring-webscripts-config-custom.xml

 <alfresco-config>

    <config evaluator="string-compare" condition="Server">
       <server>
          <scheme>http</scheme>
          <hostname>your-public-host</hostname>
          <port>your-port</port>
          <path>alfresco</path>
       </server>
    </config>

 </alfresco-config>

cheers
Boriss
Comment 3 tommy27 2014-07-01 04:17:11 UTC
are you still seeing this with current LibO 4.2.5.2 release?
Comment 4 Julien Nabet 2014-10-22 21:04:08 UTC
No feedback since more than 1 year. I put it WFM.

Don't hesitate to reopen this tracker if you still reproduce the problem after having tried comment 2 and updated to last LO version 4.3.2