[
https://issues.apache.org/jira/browse/ARTEMIS-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17869479#comment-17869479
]
Justin Bertram commented on ARTEMIS-4956:
-----------------------------------------
Do you have any logs you can share? Does the broker log anything? Have you
enabled SSL debug logging for the JVM? If so, what did it show?
How are you generating the certs? Are they self-signed or signed by a trusted
authority?
It might be best for you to work up a reproducible test-case and push it to a
GitHub repo or something like that.
> How to solve mqtt over websocket when mqtt using tls?
> ------------------------------------------------------
>
> Key: ARTEMIS-4956
> URL: https://issues.apache.org/jira/browse/ARTEMIS-4956
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Broker, MQTT
> Affects Versions: 2.17.0, 2.24.0
> Reporter: windy
> Priority: Major
> Attachments: 小Q截图-20240729152045.png
>
>
> !小Q截图-20240729152045.png!
> *configurations:*
> {{broker.xml{}}}:
> {code:xml}
> <acceptor
> name="mqtttls">tcp://0.0.0.0:1883?sslEnabled=true;sslProvider=OPENSSL;keyStorePath=/data/mqtt_ssl/mqtt_broker.keystore;keyStorePassword=12345;trustStorePath=/data/mqtt_ssl/mqtt_broker.truststore;trustStorePassword=12345;needClientAuth=true;tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=MQTT;useEpoll=true;producerMaxRate=5;handshake-timeout=120</acceptor>{code}
> {{testPage.html}}:
> {noformat}
> <!DOCTYPE html>
> <html lang="en">
> <head>
> <meta charset="UTF-8" />
> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
> <title>MQTT over WebSocket</title>
> <script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
> </head>
> <body>
> </body>
> <script>
> const clientId = 'mqttjs_' + Math.random().toString(16).substring(2, 8)
>
> const connectUrl = 'wss://xxxxx:1883'
> const options = {
> keepalive: 30,
> clientId: clientId,
> clean: true,
> connectTimeout: 5000,
> username: 'test',
> password: 'test',
> reconnectPeriod: 1000,
> key: KEY,
> cert: CERT,
> ca: CA_CERT,
> }
> const topic = '/WebSocket/mqtt'
> const payload = 'WebSocket mqtt test'
> const qos = 0
> console.log('connecting mqtt client')
> const client = mqtt.connect(connectUrl, options)
> client.on('connect', () => {
> console.log('Client connected:' + clientId)
> client.subscribe(topic, { qos }, (error) => {
> if (error) {
> console.log('Subscribe error:', error)
> return
> }
> console.log(`Subscribe to topic ${topic}`)
> }
> )
> </script>
> </html>{noformat}
> Run error:
> The server always auto disconnect the connection
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact