-
Notifications
You must be signed in to change notification settings - Fork 722
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
Help with SNI #734
Comments
I believe you wish to change
One option would be to do this via DNS (e.g. a CNAME for Alternatively see the subclass example. Using this technique you can override As this would seem to be a fairly rare requirement I'm going to leave it there; please let us know if that is useful or you believe modifications to the library are needed (given this was logged sometime ago I'd guess you may already have a solution). |
Just adding my 2 cents to this issue: I was looking for the same option (specify the The work-around we applied: import paho.mqtt.client as mqtt
import ssl
import socket as _socket
ip = "127.2.3.4"
port = 8883
host = "foo.example.com"
client_id = "foo"
class ServerNameClient(mqtt.Client):
def _ssl_wrap_socket(self, tcp_sock: _socket.socket) -> ssl.SSLSocket:
orig_host = self._host
self._host = host
res = super()._ssl_wrap_socket(tcp_sock)
self._host = orig_host
return res
mc = ServerNameClient(mqtt.CallbackAPIVersion.VERSION2, client_id=client_id)
...
mc.connect(ip, port=port)
mc.loop_forever() In other threads regarding SNI (i.e. #133 (comment)) there was some fear that adding it may confuse users but that might be avoidable if the
and that |
Hi Team ,
i have a Multiple MQTT Broker hosted in K8's , these MQTT Brokers are behind the ingress controller
ingress controller routes the traffic to appropriate broker based on SNI
for non TLS i am able to verify the connection using below command
openssl s_client -showcerts -connect istio-test.westus2.cloudapp.azure.com:8883 -servername example1.test.com
openssl s_client -showcerts -connect istio-test.westus2.cloudapp.azure.com:8883 -servername example2.test.com
with TLS traffic i am not able to set specific SNI (servername).
By default SNI going as istio-test.westus2.cloudapp.azure.com
please fine the sample i am trying
Can some one help me here
The text was updated successfully, but these errors were encountered: