Thread: pgAdmin4 behind HTTPs

pgAdmin4 behind HTTPs

From
Stefan Tzeggai
Date:
Hi

I installed pgAdmin4 2.0 in SERVER-Mode. It listens on Port 5050 by default.

Now I configured Apache2 to proxy external https access to localhost:5050

> ProxyPass         / http://localhost:5050/   timeout=600
> ProxyPassReverse  / http://localhost:5050/   timeout=600

The proxying works, but after some cliks, e.g. after the login, pgAdmin4
changes the URL to HTTP without SSL. Hich of course results in an error:

> Your browser sent a request that this server could not understand.
> Reason: You're speaking plain HTTP to an SSL-enabled server port.
> Instead use the HTTPS scheme to access this URL, please.


So my question: Is there a way to tell pgAdmin4 that it has an external
URL using https ?

Thanks
Steve



Re: pgAdmin4 behind HTTPs

From
Dave Page
Date:

> On 21 Nov 2017, at 20:06, Stefan Tzeggai <tzeggai@empirica-systeme.de> wrote:
>
> Hi
>
> I installed pgAdmin4 2.0 in SERVER-Mode. It listens on Port 5050 by default.
>
> Now I configured Apache2 to proxy external https access to localhost:5050
>
>> ProxyPass         / http://localhost:5050/   timeout=600
>> ProxyPassReverse  / http://localhost:5050/   timeout=600
>
> The proxying works, but after some cliks, e.g. after the login, pgAdmin4
> changes the URL to HTTP without SSL. Hich of course results in an error:
>
>> Your browser sent a request that this server could not understand.
>> Reason: You're speaking plain HTTP to an SSL-enabled server port.
>> Instead use the HTTPS scheme to access this URL, please.
>
>
> So my question: Is there a way to tell pgAdmin4 that it has an external
> URL using https ?
>
> Thanks
> Steve
>
>

Can you pinpoint what clicks cause this? I haven’t seen the problem and have a server running this way.

Thanks.

Re: pgAdmin4 behind HTTPs

From
Stefan Tzeggai
Date:
Hi

Am 21.11.2017 um 21:09 schrieb Dave Page:
> 
> 
>> On 21 Nov 2017, at 20:06, Stefan Tzeggai <tzeggai@empirica-systeme.de> wrote:
>>
>> Hi
>>
>> I installed pgAdmin4 2.0 in SERVER-Mode. It listens on Port 5050 by default.
>>
>> Now I configured Apache2 to proxy external https access to localhost:5050
>>
>>> ProxyPass         / http://localhost:5050/   timeout=600
>>> ProxyPassReverse  / http://localhost:5050/   timeout=600
>>
>> The proxying works, but after some cliks, e.g. after the login, pgAdmin4
>> changes the URL to HTTP without SSL. Hich of course results in an error:
>>
>>> Your browser sent a request that this server could not understand.
>>> Reason: You're speaking plain HTTP to an SSL-enabled server port.
>>> Instead use the HTTPS scheme to access this URL, please.
>>
>>
>> So my question: Is there a way to tell pgAdmin4 that it has an external
>> URL using https ?
>>
>> Thanks
>> Steve
>>
>>
> 
> Can you pinpoint what clicks cause this? I haven’t seen the problem and have a server running this way.

Actually it starts with the login. I have the HTTPS running on this port
554. I click the following links:

https://alfonx.dyndns-ip.com:554/loginOR
https://alfonx.dyndns-ip.com:554/login?next=%2Fbrowser%2F

Bith both links I get the login page, but after I logged in I end up at:

http://alfonx.dyndns-ip.com:554/  <- NO HTTPS anymore :-(

Greetings
Steve

-- 
empirica-systeme GmbH
Stefan Tzeggai
Brunsstr. 31
72074 Tübingen
email tzeggai@empirica-systeme.de
phone  +49 7071 6392922
mobile +49 176 40 38 9559

"Wer nichts zu verbergen hat, braucht auch keine Hose!"



Re: pgAdmin4 behind HTTPs

From
Dave Page
Date:


On Wed, Nov 22, 2017 at 8:49 AM, Stefan Tzeggai <tzeggai@empirica-systeme.de> wrote:

Hi

Am 21.11.2017 um 21:09 schrieb Dave Page:
>
>
>> On 21 Nov 2017, at 20:06, Stefan Tzeggai <tzeggai@empirica-systeme.de> wrote:
>>
>> Hi
>>
>> I installed pgAdmin4 2.0 in SERVER-Mode. It listens on Port 5050 by default.
>>
>> Now I configured Apache2 to proxy external https access to localhost:5050
>>
>>> ProxyPass         / http://localhost:5050/   timeout=600
>>> ProxyPassReverse  / http://localhost:5050/   timeout=600
>>
>> The proxying works, but after some cliks, e.g. after the login, pgAdmin4
>> changes the URL to HTTP without SSL. Hich of course results in an error:
>>
>>> Your browser sent a request that this server could not understand.
>>> Reason: You're speaking plain HTTP to an SSL-enabled server port.
>>> Instead use the HTTPS scheme to access this URL, please.
>>
>>
>> So my question: Is there a way to tell pgAdmin4 that it has an external
>> URL using https ?
>>
>> Thanks
>> Steve
>>
>>
>
> Can you pinpoint what clicks cause this? I haven’t seen the problem and have a server running this way.

Actually it starts with the login. I have the HTTPS running on this port
554. I click the following links:

https://alfonx.dyndns-ip.com:554/login
 OR
https://alfonx.dyndns-ip.com:554/login?next=%2Fbrowser%2F

Bith both links I get the login page, but after I logged in I end up at:

http://alfonx.dyndns-ip.com:554/  <- NO HTTPS anymore :-(

Does it behave as expected if you run on 443? 

FYI, I tried using my docker container (which uses port 443) but mapped it to 554 on the host, and it seems to stick to https. e.g.

piranha:~ dpage$ docker run -p 554:443 -v "/Users/dpage/certs/pgadmin.org.pem:/certs/server.cert" -v "/Users/dpage/certs/pgadmin.org.key:/certs/server.key" -e "PGADMIN_DEFAULT_EMAIL=user@domain.com" -e "PGADMIN_DEFAULT_PASSWORD=SuperSecret" -e "PGADMIN_ENABLE_TLS=True" -e "PGADMIN_SERVER_NAME=test.pgadmin.org" -d dpage/pgadmin4

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company