title: disconnecting mosquitto broker for large message in websocket with TLS/SSL connection
body: <p>Unsecured (without TLS/SSL) mosquitto broker works good to send large amount of data &gt;10000 bytes in websocket connection . Work good too in mqtts:// connection (With TLS/SSL) for large message .</p>
  <p>Unfortunatelly mosquitto disconnecting when I try send larg message by websocket wss:// (with TLS/SSL).</p>
  <p>Problem with disconnecting is from our client software and from third-party softwares for example MQTT Explorer.</p>
  <p>mosquitto.conf:</p>
  <pre><code>log_type all
  acl_file /etc/mosquitto/acl
  
  allow_anonymous false
  password_file /etc/mosquitto/passwd
  
  listener 1883 localhost
  
  listener 8883
  certfile /etc/letsencrypt/live/mqtt.our_domain_name.com.pl/cert.pem
  cafile /etc/letsencrypt/live/mqtt.our_domain_name.com.pl/chain.pem
  keyfile /etc/letsencrypt/live/mqtt.our_domain_name.com.pl/privkey.pem
  
  listener 8083
  protocol websockets
  certfile /etc/letsencrypt/live/mqtt.our_domain_name.com.pl/cert.pem
  cafile /etc/letsencrypt/live/mqtt.our_domain_name.com.pl/chain.pem
  keyfile /etc/letsencrypt/live/mqtt.our_domain_name.com.pl/privkey.pem
  </code></pre>
  <p>I have mosquitto 1.5.7 on debian &quot;buster&quot; on VPS from OVH</p>
  <p>I clear mosquitto.log file, restart mosquitto and send long message from mqtt-explorer. Bellow is log.</p>
  <pre><code>1627626417: mosquitto version 1.5.7 starting
  1627626417: Config loaded from /etc/mosquitto/mosquitto.conf. 
  1627626417: Opening ipv6 listen socket on port 1883. 
  1627626417: Opening ipv4 listen socket on port 1883. 
  1627626417: Opening ipv4 listen socket on port 8883. 
  1627626417: Opening ipv6 listen socket on port 8883. 
  1627626417: Opening websockets listen socket on port 8083. 
  1627626447: New client connected from 5.133.8.116 as mqtt-explorer-a0f97f30 (c1, k60, u'5ff4667a0a1e1c2f28934009'). 
  1627626447: No will message specified. 
  1627626447: Sending CONNACK to mqtt-explorer-a0f97f30 (0, 0) 
  1627626448: Received SUBSCRIBE from mqtt-explorer-a0f97f30 
  1627626448:     # (QoS 0) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60978f68f553959dd44666be/set/layout', ... (3697 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60195d4694d0560017816a25/get/jasnosc', ... (3 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60a2bf639cb2e72aa8993fa7/set/layout', ... (3697 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60a4ddb4c3a2ae262c93374c/set/layout', ... (3697 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60a4e35bc3a2ae262c93374e/set/layout', ... (3184 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/6047d95212977e03d075a5cc/set/layout', ... (2583 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba2aa2360b9c00155b2626/set/layout', ... (3695 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba30d6360b9c00155b2628/set/layout', ... (2582 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba32e8360b9c00155b262a/set/layout', ... (2582 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba3588360b9c00155b262c/set/layout', ... (2582 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba7b8205f2f4001529b702/set/layout', ... (861 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba78c405f2f4001529b700/set/layout', ... (2582 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bb3d9be4736f0015b5a36f/set/layout', ... (2583 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bb3d9be4736f0015b5a370/set/layout', ... (2583 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bb45fbe4736f0015b5a373/set/layout', ... (861 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bceffceb10e10015e339ff/set/layout', ... (2580 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bcf112eb10e10015e33a01/set/layout', ... (2580 bytes))
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bcf5b0eb10e10015e33a05/set/layout', ... (2580 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd148069ec7a001535facc/set/layout', ... (2584 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd228acd2e680015ffa08e/set/layout', ... (2581 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd2342cd2e680015ffa090/set/layout', ... (2580 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd2498cd2e680015ffa093/set/layout', ... (2580 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd2587cd2e680015ffa095/set/layout', ... (2582 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ca59ee58a5db0015647290/set/layout', ... (861 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/test', ... (1 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f6da814c56ff00156586e0/set/layout', ... (8769 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f7d9b92af7d900150246e1/set/layout', ... (8769 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f80774f9df0b0015a845c1/set/layout', ... (8 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f9614c4c8e00001522396d/set/layout', ... (8 bytes)) 
  1627626448: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60faa1db4879b60015b9ea3d/set/layout', ... (8 bytes)) 
  1627626448: mqtt-explorer-a0f97f30 0 # 
  1627626448: Sending SUBACK to mqtt-explorer-a0f97f30 
  1627626448: Received SUBSCRIBE from mqtt-explorer-a0f97f30 
  1627626448:     $SYS/# (QoS 0) 
  1627626448: mqtt-explorer-a0f97f30 0 $SYS/# 
  1627626448: Sending SUBACK to mqtt-explorer-a0f97f30 
  1627626501: Socket error on client mqtt-explorer-a0f97f30, disconnecting. 
  1627626503: New client connected from 5.133.8.116 as mqtt-explorer-a0f97f30 (c1, k60, u'5ff4667a0a1e1c2f28934009'). 
  1627626503: No will message specified. 
  1627626503: Sending CONNACK to mqtt-explorer-a0f97f30 (0, 0) 
  1627626503: Received SUBSCRIBE from mqtt-explorer-a0f97f30 
  1627626503:     # (QoS 0) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60978f68f553959dd44666be/set/layout', ... (3697 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60195d4694d0560017816a25/get/jasnosc', ... (3 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60a2bf639cb2e72aa8993fa7/set/layout', ... (3697 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60a4ddb4c3a2ae262c93374c/set/layout', ... (3697 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60a4e35bc3a2ae262c93374e/set/layout', ... (3184 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/6047d95212977e03d075a5cc/set/layout', ... (2583 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba2aa2360b9c00155b2626/set/layout', ... (3695 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba30d6360b9c00155b2628/set/layout', ... (2582 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba32e8360b9c00155b262a/set/layout', ... (2582 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba3588360b9c00155b262c/set/layout', ... (2582 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba7b8205f2f4001529b702/set/layout', ... (861 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ba78c405f2f4001529b700/set/layout', ... (2582 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bb3d9be4736f0015b5a36f/set/layout', ... (2583 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bb3d9be4736f0015b5a370/set/layout', ... (2583 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bb45fbe4736f0015b5a373/set/layout', ... (861 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bceffceb10e10015e339ff/set/layout', ... (2580 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bcf112eb10e10015e33a01/set/layout', ... (2580 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bcf5b0eb10e10015e33a05/set/layout', ... (2580 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd148069ec7a001535facc/set/layout', ... (2584 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd228acd2e680015ffa08e/set/layout', ... (2581 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd2342cd2e680015ffa090/set/layout', ... (2580 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd2498cd2e680015ffa093/set/layout', ... (2580 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60bd2587cd2e680015ffa095/set/layout', ... (2582 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60ca59ee58a5db0015647290/set/layout', ... (861 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/test', ... (1 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f6da814c56ff00156586e0/set/layout', ... (8769 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f7d9b92af7d900150246e1/set/layout', ... (8769 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f80774f9df0b0015a845c1/set/layout', ... (8 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60f9614c4c8e00001522396d/set/layout', ... (8 bytes)) 
  1627626503: Sending PUBLISH to mqtt-explorer-a0f97f30 (d0, q0, r1, m0, '5ff4667a0a1e1c2f28934009/60faa1db4879b60015b9ea3d/set/layout', ... (8 bytes)) 
  1627626503: mqtt-explorer-a0f97f30 0 # 
  1627626503: Sending SUBACK to mqtt-explorer-a0f97f30 
  1627626503: Received SUBSCRIBE from mqtt-explorer-a0f97f30 
  1627626503:     $SYS/# (QoS 0) 
  1627626503: mqtt-explorer-a0f97f30 0 $SYS/# 
  1627626503: Sending SUBACK to mqtt-explorer-a0f97f30 
  1627626512: New client connected from 178.235.180.207 as web-8SnSOhLrPi (c1, k60, u'5ff4667a0a1e1c2f28934009'). 
  1627626512: No will message specified. 
  1627626512: Sending CONNACK to web-8SnSOhLrPi (0, 0) 
  1627626563: Received PINGREQ from mqtt-explorer-a0f97f30 
  1627626563: Sending PINGRESP to mqtt-explorer-a0f97f30 
  1627626571: Socket error on client web-8SnSOhLrPi, disconnecting. 
  1627626623: Received PINGREQ from mqtt-explorer-a0f97f30 
  1627626623: Sending PINGRESP to mqtt-explorer-a0f97f30 
  1627626632: New client connected from 178.235.180.207 as web-8SnSOhLrPi (c1, k60, u'5ff4667a0a1e1c2f28934009'). 
  1627626632: No will message specified. 
  1627626632: Sending CONNACK to web-8SnSOhLrPi (0, 0) 
  1627626683: Received PINGREQ from mqtt-explorer-a0f97f30 
  1627626683: Sending PINGRESP to mqtt-explorer-a0f97f30 
  1627626691: Socket error on client web-8SnSOhLrPi, disconnecting. 
  1627626743: Received PINGREQ from mqtt-explorer-a0f97f30 
  1627626743: Sending PINGRESP to mqtt-explorer-a0f97f30 
  1627626752: New client connected from 178.235.180.207 as web-8SnSOhLrPi (c1, k60, u'5ff4667a0a1e1c2f28934009'). 
  1627626752: No will message specified. 
  1627626752: Sending CONNACK to web-8SnSOhLrPi (0, 0) 
  1627626803: Received PINGREQ from mqtt-explorer-a0f97f30 
  1627626803: Sending PINGRESP to mqtt-explorer-a0f97f30 
  1627626811: Socket error on client web-8SnSOhLrPi, disconnecting.
  </code></pre>
  <p>I too try update mosquitto with instruction on page: <a href="https://mosquitto.org/blog/2013/01/mosquitto-debian-repository/" rel="nofollow noreferrer">https://mosquitto.org/blog/2013/01/mosquitto-debian-repository/</a></p>
  <p>When I do all commands from instruction I cant run mossquitto broker.</p>
  <p>There is a problem in mosquitto.log with CA Certificate. What can I do?</p>
  <pre><code>1627628479: Config loaded from /etc/mosquitto/mosquitto.conf.  
  1627628479: Opening ipv6 listen socket on port 1883. 
  1627628479: Opening ipv4 listen socket on port 1883. 
  1627628479: Opening ipv4 listen socket on port 8883. 
  1627628479: Opening ipv6 listen socket on port 8883. 
  1627628479: Error: Unable to load CA certificates. Check cafile &quot;/etc/letsencrypt/live/mqtt.fulldesign.com.pl/chain.pem&quot;. 
  1627628479: Error: Unable to load server certificate &quot;/etc/letsencrypt/live/mqtt.fulldesign.com.pl/cert.pem&quot;. Check certfile. 
  1627628479: OpenSSL Error[0]: error:0200100D:system library:fopen:Permission denied 
  1627628479: OpenSSL Error[1]: error:20074002:BIO routines:file_ctrl:system lib 
  1627628479: OpenSSL Error[2]: error:140DC002:SSL  routines:use_certificate_chain_file:system lib
  </code></pre>