-
Notifications
You must be signed in to change notification settings - Fork 616
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
[WARN]: tcp: tls: first record does not look like a TLS handshake when terminating TLS #855
Comments
Your fabio configuration looks correct, but the fabio message is telling you that your mosquito client is not trying to do a TLS handshake. I am not familiar enough with mosquito to troubleshoot this issue. |
Okay, looking at the mosquito docs, 8883 is a "magic" port that denotes tcps. Fabio will match the 8883 service for mqtt, which expects encryption. So fabio is terminating TLS, then sending to the encrypted mosquito port of 8883. One option would be to set up only one service entry for consul, do urlprefix tag be urlprefix-:8883, and it could also have the tag of urlprefix-:1883, and have the service port actually be 1883. Don't register a consul service for port 8883. This will have the effect of forwarding traffic that came from 8883 to be forwarded to the service port 1883 after terminating TLS, and forwarding 1883 as-is (no TLS). Anyway, that's about as far as I can go with my current knowledge of moqsuito |
Hmmm, that makes things worse @nathanejohnson. I tried having a single tag ...whereas with 2 separate service definitions I get this: For reference, the service definitions in my service {
name = "mqtt"
task = "mqtt"
tags = [
"service",
"urlprefix-:1883 proto=tcp", // mqtt.mooncarrot.space
]
address_mode = "host"
port = "mqtt"
check {
type = "tcp"
port = "mqtt"
interval = "60s"
timeout = "10s"
}
}
service {
name = "mqtts"
task = "mqtt"
tags = [
"service",
"urlprefix-:8883 proto=tcp" // mqtt.mooncarrot.space; TLS termination is configured in fabio.properties
]
address_mode = "host"
port = "mqtt"
check {
type = "tcp"
port = "mqtt"
interval = "60s"
timeout = "10s"
}
} |
That's... really odd. Two urlprefix inside the same tag will never work, but I'm not sure why two urlprefix tags on the same service isn't. With that said, does having two services on port 1833 but with different urlprefix tags actually work as expected? |
When I configure Fabio to terminate TLS for a Mosquitto MQTT server, I get the following error:
My setup is such:
The following instructions were derived from the official documentation at https://fabiolb.net/feature/tcp-proxy/.
Steps to reproduce
sudo apt install mosquitto
, more in depth tutorial, part 2)mqtts
with the tagsurlprefix-:8883
andproto=tcp
, andmqtt
with the tagsurlprefix-:1883
andproto=tcp
mosquitto_sub
(sudo apt install mosquitto-clients
):Additional system info:
uname -a
:Linux SERVER_NAME 5.10.52-v7l+ #1441 SMP Tue Aug 3 18:11:56 BST 2021 armv7l GNU/Linux
fabio -v
:1.5.15
The text was updated successfully, but these errors were encountered: