jpmens / mosquitto-auth-plug

Authentication plugin for Mosquitto with multiple back-ends (MySQL, Redis, CDB, SQLite3)
Other
825 stars 496 forks source link

Issue with JWT on port 443 of 127.0.0.1 #342

Closed shahabmusic closed 6 years ago

shahabmusic commented 6 years ago

I keep receiving "Socket error on client , disconnecting" as soon as I configure TLS/SSL on my apache which is on the same server. It works fine while ssl/tls is disabled.

here is my mosquitto.conf: _auth_opt_backends jwt auth_opt_http_ip 127.0.0.1 auth_opt_http_port 443 auth_opt_http_with_tls true auth_opt_http_getuser_uri /auth/ auth_opt_http_superuser_uri /superuser/ auth_opt_http_aclcheckuri /acl/

I tried replacing 127.0.0.1 with public IP of the server and it didn't help. What do you think I doing wrong?

it works if I run my apache with tls enabled on a separate server. The issue arise only when both apache and mosquitto are on the same server (and apache is ssl enabled)

jpmens commented 6 years ago

I assume your TLS certificate doesn't have SANs for localhost. As you're on 127.0.0.1 I don't see the need for complicating the issue; I'd use 127.0.0.1:80 and be done with it.