Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Koen De Jaeger
Server runs https but PortletUtil.isSecure still returns false
8 octobre 2013 02:39
Réponse

Koen De Jaeger

Rang: New Member

Publications: 13

Date d'inscription: 14 septembre 2010

Publications Récentes

Our server (https://mijn.pvda.nl/) is running on https.
Apache was configured by another company, so I don't know the details. It seems it redirects all traffic to https.
I had to add "web.server.protocol=https" for Liferay to generate the links in https.

Everything works fine but PortletUtil.isSecure still returns false in portlets like Google Maps. I also verified with the scriptingconsole with "println(actionRequest.isSecure());". Also returns 'false'.

Can I still change some portal-env property entry to fix this or would it be the apache/tomcat configuration that needs to be adapted?
I have not yet overridden these:
#
# Set the HTTP and HTTPs ports when running the portal in a J2EE server that
# is sitting behind another web server like Apache. Set the values to -1 if
# the portal is not running behind another web server like Apache.
#
web.server.http.port=-1
web.server.https.port=-1

II think I have to add these ports (80/443). I wonder if this is really necessary though and if it would solve the problem.
David H Nebinger
RE: Server runs https but PortletUtil.isSecure still returns false
8 octobre 2013 05:30
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11046

Date d'inscription: 1 septembre 2006

Publications Récentes

Could be apache is using AJP to communicate w/ your Liferay instance. Setting the https flags just has Liferay generate the URLs to be https, doesn't mean that it is necessarily using https itself.
Koen De Jaeger
RE: Server runs https but PortletUtil.isSecure still returns false
9 octobre 2013 08:44
Réponse

Koen De Jaeger

Rang: New Member

Publications: 13

Date d'inscription: 14 septembre 2010

Publications Récentes

I got some feedback.

Apparently they avoided AJP because they had a problem with configuring that.

Tomcat is still on the http connector and apache is done with ProxyPass.

Apache :
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://localhost:8081/
ProxyPassReverse / http://localhost:8081/

I guess they could try to follow both of your guides ? :
https://www.liferay.com/web/26526/blog/-/blogs/fronting-liferay-tomcat-with-apache-httpd-daemon
https://www.liferay.com/web/26526/blog/-/blogs/liferay-and-ssl
David H Nebinger
RE: Server runs https but PortletUtil.isSecure still returns false
9 octobre 2013 09:21
Réponse

David H Nebinger

Community Moderator

Rang: Liferay Legend

Publications: 11046

Date d'inscription: 1 septembre 2006

Publications Récentes

well i'm using ajp in my guides, but they should help you get up and running that way...
Mika Koivisto
RE: Server runs https but PortletUtil.isSecure still returns false
10 octobre 2013 15:33
Réponse

Mika Koivisto

LIFERAY STAFF

Rang: Liferay Legend

Publications: 1512

Date d'inscription: 7 août 2006

Publications Récentes

Tomcat doesn't know it's on https when it's configured like that. That is why request.isSecure() returns false. To fix that you could create a new http connector in tomcat and set secure="true" in it. That way when you ask the container if the request is secure it will say yes.