Page 1 of 1

Push not working on https

Posted: 12 May 2017, 16:49
by pibi_calderon
Hi,

I am just testing Primefaces push on your showcase, it is used to work when the page was using http only. Now that it is using https it doesn't work anymore, and javascript console shows this error

Code: Select all

Mixed Content: The page at 'https://www.primefaces.org/showcase/push/counter.xhtml' was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoint 'ws://www.primefaces.org:8080/showcase/primepush/counter?X-Atmosphere-tracking-id...ransport=websocket&X-Atmosphere-TrackMessageSize=true&X-atmo-protocol=true'. This request has been blocked; this endpoint must be available over WSS.
av @ push.js.xhtml:1
push.js.xhtml:1 Uncaught DOMException: Failed to construct 'WebSocket': An insecure WebSocket connection may not be initiated from a page loaded over HTTPS.
    at av (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:12625)
    at af (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:14751)
    at aa (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:6118)
    at AtmosphereRequest.execute (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:36292)
    at Object.a.subscribe (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:36919)
    at connect (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:45029)
    at c.init (https://www.primefaces.org/showcase/javax.faces.resource/push/push.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:44940)
    at new c (https://www.primefaces.org/showcase/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:5:437)
    at Object.createWidget (https://www.primefaces.org/showcase/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:5001)
    at Object.cw (https://www.primefaces.org/showcase/javax.faces.resource/core.js.xhtml?ln=primefaces&v=6.1-SNAPSHOT:1:4822)
I already have an application with websockes that just runs over http only, but now I have to make it run over https.
How can I establish a socket connection using WSS?

Re: Push not working on https

Posted: 06 Jun 2017, 14:07
by jcon321
using apache as your reverse proxy? try with the option "ProxyVia On"

Re: Push not working on https

Posted: 06 Jun 2017, 17:13
by pibi_calderon
I am just using tomcat... no apache at the front... where do I set the option "ProxyVia On"?