Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to establish SSL connection #632

Closed
vorburger opened this issue Apr 27, 2019 · 4 comments
Closed

Unable to establish SSL connection #632

vorburger opened this issue Apr 27, 2019 · 4 comments

Comments

@vorburger
Copy link
Contributor

Anyone got a clue what's going on here:

docker run --name alfio-db -e POSTGRES_DB=postgres -e POSTGRES_USERNAME=postgres -e POSTGRES_PASSWORD=alfiopassword --restart=always -d -v /path/to/local/data:/var/lib/postgresql/data postgres

docker run --name alfio --link alfio-db:postgres -p 8080:8080 -p 8443:8443 -e "POSTGRES_ENV_USE_SSL=disable" -d alfio/alf.io:1.16.3

wget http://localhost:8080/                                                                                                        
--2019-04-27 23:00:43--  http://localhost:8080/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://localhost:8443/ [following]
--2019-04-27 23:00:44--  https://localhost:8443/
Connecting to localhost (localhost)|::1|:8443... connected.
GnuTLS: The TLS connection was non-properly terminated.
Unable to establish SSL connection.

PS: The -p (x2) & POSTGRES_ENV_USE_SSL are proposed to be documented in #631 (without those, it works even less).

@vorburger
Copy link
Contributor Author

I am hitting another SSL problem when I run Alf.io locally (in non-dev mode) like this:

docker run --name alfio-db -e POSTGRES_DB=postgres -e POSTGRES_USERNAME=postgres -e POSTGRES_PASSWORD=alfiopassword -p 5432:5432 --restart=always -d postgres

git clone https://github.com/alfio-event/alf.io.git ; cd alf.io
git checkout 1.x-maintenance
./gradlew build

export POSTGRES_PORT_5432_TCP_ADDR=localhost
export POSTGRES_PORT_5432_TCP_PORT=5432
export POSTGRES_ENV_POSTGRES_DB=postgres
export POSTGRES_ENV_POSTGRES_USERNAME=postgres
export POSTGRES_ENV_POSTGRES_PASSWORD=alfiopassword
export POSTGRES_ENV_USE_SSL=disable

java -jar build/libs/alfio-1.17-SNAPSHOT-boot.war

wget --no-check-certificate http://localhost:8080/admin/
--2019-04-27 23:42:48--  http://localhost:8080/admin/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://localhost:8443/admin/ [following]
--2019-04-27 23:42:48--  https://localhost:8443/admin/
Connecting to localhost (localhost)|::1|:8443... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8443... failed: Connection refused.
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8443... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8443... failed: Connection refused.

So this SSL problem doesn't seem to be related to the alfio/alf.io:1.16.3 container image (but note that it's not exactly the same error as above).

@vorburger
Copy link
Contributor Author

It of course works with export SPRING_PROFILES_ACTIVE=dev ... but that leads to an (ugly) "You are running alf.io in development mode" blue footer... I want to run it in production (and let something else deal with HTTPS).

@cbellone
Copy link
Member

Hi @vorburger

You don't have to deal with HTTPS, you can terminate the SSL connection on the proxy.

You've just to make sure that your proxy forwards the right headers:
#511 (comment)

here an example of working httpd configuration file, courtesy of @asymmetric:
#363 (comment)

@cbellone
Copy link
Member

closed for inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants