Confluence https rest requests fail, http rest requests succeeds

Andreas Lundström October 18, 2016

Hi, how would cause rest requests towards an confluence instance on https fail while rest requests towards http succeed?

 

An (truncated) example:

 

curl -D- -X GET -H "Authorization: Basic <base64 encoded user:pass>" http://mydomain/confluence/rest/api/content/12345

HTTP/1.1 200 OK
Date: Wed, 19 Oct 2016 07:36:50 GMT
Server: Apache-Coyote/1.1
X-ASEN: SEN-4713507
X-Seraph-LoginReason: OK
X-AUSERNAME: <username>
Cache-Control: no-cache, must-revalidate
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Content-Type-Options: nosniff
Content-Type: application/json
Set-Cookie: JSESSIONID=A5CC9394A692F4333B8A13A5061693E0; Path=/confluence/; HttpOnly
Connection: close
Transfer-Encoding: chunked

{"id":"33505798", ... }

 


curl -D- -X GET -H "Authorization: Basic <base64 encoded user:pass>" https://mydomain/confluence/rest/api/content/12345

HTTP/1.1 404 Not Found
Date: Wed, 19 Oct 2016 07:36:44 GMT
Server: Apache-Coyote/1.1
X-ASEN: SEN-4713507
Cache-Control: no-cache, must-revalidate
Expires: Thu, 01 Jan 1970 00:00:00 GMT
X-Content-Type-Options: nosniff
Content-Type: application/json
Connection: close
Transfer-Encoding: chunked

{"statusCode":404,"data":{"authorized":false,"valid":true,"errors":[]},"message":"No content found with id: ContentId{id=12345}"}



Any ideas?

1 answer

0 votes
Jonas Andersson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 18, 2016

Looks like something in the https rewrite goes wrong as it returns a 404. I assume you are terminating SSL and http at a mod proxy in front of confluence, and point the traffic to the high port of tomcat after that? Is this a implementation that works while using a regular webbrowser, or is it all a new setup?

Andreas Lundström October 18, 2016

This is an existing setup (1y+), but integration via REST to update certain pages is new.

Andreas Lundström October 19, 2016

Perhaps 404 is a bit misleading as well, as the response actually tells us that nothing by that id was found... which should not mean that the request did not reach the endpoint?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events