Bug: Unable to Connect/Import Self-Signed Certificate from XMPP Server
Status: RESOLVED
Priority: --
Resolution: DUPLICATE
Created: 2020-10-26 02:39:06+00:00
Resolved: 2020-10-26 18:50:16+00:00

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0

Steps to reproduce:

I recently installed a copy of prosody (an XMPP server, v 0.9) on my local network, and gave it a self-signed certificate. We run a local DNS server on the lan, and I assigned the device the address 'im.pi.lan'.

However, while Pidgin and Xabber are working fine, I've been unable to connect via Thunderbird (the connection fails with the message 'the server closed the connection'). 

I assumed this was due to the self-signed certificate, and tried to add an exception. However, after entering the server and port in the certificate exception window, it claimed 'No information available', and I was unable to add the exception (see attached screenshot). 


Actual results:

Connecting to the local xmpp server with a self-signed certificate failed with the message 'the server closed the connection'. 

The debug connection log was as follows:
(Thunderbird 78.4.0 (20201019003438), Gecko 78.4.0 (20201019003438) on Windows NT 10.0; Win64; x64)
(38 messages omitted)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: _handleSrvQuery resource:///modules/xmpp-session.jsm:165)
SRV lookup: []
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: connect resource:///modules/socket.jsm:165)
Connecting to: im.pi.lan:5222
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_RESOLVING)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_RESOLVED)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_CONNECTING_TO)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_CONNECTED_TO)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: sendString resource:///modules/socket.jsm:265)
Sending:
<?xml version="1.0"?><stream:stream to="im.pi.lan" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_SENDING_TO)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_RECEIVING_FROM)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onStartRequest resource:///modules/socket.jsm:494)
onStartRequest
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: _logReceivedData resource:///modules/xmpp-xml.jsm:390)
received:
<stream:stream xmlns="http://etherx.jabber.org/streams" version="1.0" from="im.pi.lan" id="05ad4444-d6c0-497c-be14-7e05fbcf2cdf" xml:lang="en">

[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: _logReceivedData resource:///modules/xmpp-xml.jsm:390)
received:
<stream:features xmlns="http://etherx.jabber.org/streams">
 <starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls">
  <required xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>
 </starttls>
</stream:features>

[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: sendString resource:///modules/socket.jsm:265)
Sending:
<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls" id="8828915b-a829-43be-9b5b-3b49161ed9ab"/>
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_SENDING_TO)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: onTransportStatus resource:///modules/socket.jsm:572)
onTransportStatus(STATUS_RECEIVING_FROM)
[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: _logReceivedData resource:///modules/xmpp-xml.jsm:390)
received:
<proceed xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>

[10/25/2020, 7:23:59 PM] DEBUG (@ prpl-jabber: sendString resource:///modules/socket.jsm:265)
Sending:
<?xml version="1.0"?><stream:stream to="im.pi.lan" xmlns="jabber:client" xmlns:stream="http://etherx.jabber.org/streams" version="1.0">
[10/25/2020, 7:24:00 PM] DEBUG (@ prpl-jabber: onStopRequest resource:///modules/socket.jsm:503)
onStopRequest (2153398258)
[10/25/2020, 7:24:00 PM] DEBUG (@ prpl-jabber: disconnect resource:///modules/socket.jsm:210)
Disconnect

Additionally, I was unable to add a certificate exception because Thunderbird seemed unable to fetch the certificate from the server. 


Expected results:

I should have been able to connect to the local server (either with a warning the certificate was self signed, or the ability to provide an override). 

While there was a bug about XMPP connectivity and self-signed certificates several years ago (https://bugzilla.mozilla.org/show_bug.cgi?id=780749) it was previously resolved after an instabird update 6 years ago, so I suspect this is a new issue.