26

I am getting the following error on Pidgin 2.10.10-3.fc20 (libpurple 2.10.10).

How can I force it to accept an invalid certificate?

(According to this bug report it should be capable).

enter image description here

Here's what I have done:

  • visited the domain on Firefox, and exported the certificate
  • imported the certificate on Pidgin tools->certificates
  • Imported the certificate on seahorse (gnome keyring GUI)

8 Answers8

17

As alternative you can download the ssl certificate by hand. Afterwards pidgin starts without problems. To download the certificate you can use openssl command line utility.

~/.purple/certificates/x509/tls_peers$ openssl s_client -connect YOUR_SERVER:PORTNUMBER  

When the above command fails with "no peer certificate available" then maybe the server uses STARTTLS instead of SSL. In this case use the following command:

~/.purple/certificates/x509/tls_peers$ openssl s_client -connect YOUR_SERVER:PORTNUMBER -starttls xmpp

Now copy the part beginning with "----BEGIN CERTIFICATE----". If you print the content of the certificate file it looks like the following:

~/.purple/certificates/x509/tls_peers$ cat jabber.ulm.ccc.de 

-----BEGIN CERTIFICATE-----
MIIFXDCCA0QCCQCa5jxvwccm0DANBgkqhkiG9w0BAQUFADBwMQswCQYDVQQGEwJE
RTEMMAoGA1UEBxMDVWxtMRUwEwYDVQQLEwxDQ0MgRXJmYSBVbG0xGjAYBgNVBAMT
EWphYmJlci51bG0uY2NjLmRlMSAwHgYJKoZIhvcNAQkBFhFqYWJiZXJAdWxtLmNj
...
3EIpMVk3V1djyj0FEuDaG/o+6BTLCiIMiIUFtbpVz8YZChHbv8ObMJ5JpUIkDfKZ
si1YZKpUYwpVXgTCUml67lArx/sq95OQsDSO3fR1Ch0=
-----END CERTIFICATE-----
Martin
  • 361
11

Turns out it there's a bug with certificates in Pidgin 2.10.10 (libpurple 2.10.10):

In version 2.10.10 it's no longer possible to connect to a XMPP server which uses a self signed SSL certificate. The error message is: The certificate for could not be validated. The certificate chain presented is invalid.

The connection is possible if the server certificate is already in the local cache (.purple\certificates\x509\tls_peers). If the certificate is not cached yet (e.g. after a fresh windows/pidgin installation) the connection fails.

Upgrading to 2.10.11 fixes the issue. If you're using an older Ubuntu version like me, you can use the PPA (12.04, 14.04 and 14.10)

2

It seems to be important that the name you enter when importing the certificate via ToolsCertificates matches the connect server in the XMPP account configuration. This is the only way I was able to get it to work for the same error.

Connect server and certificate hostname should match

Fabby
  • 35,017
tobigue
  • 121
2

Another workaround is to import the name of the server specified in the error like myserver.chat.com. For example:

  1. Open the Firefox browser and put the URL: HTTPS://mysever.chat.com, you'll get an error:

    Invalid certificate error

  2. Select, Advanced option then Add Exception. A popup for the certificate will open.

  3. Then click Advanced -> Details -> Export

    Certificate Viewer

  4. Save the certificate somewhere

  5. Open Pidgin, go to Tools -> Certificates -> Add Now save the certificate with the same common name as the error in the beginning.

Finally, try to reconnect.

Y Melo
  • 201
2

Easy Way,

  1. Close Pidgin
  2. Find your certificates folder (Win­dows: %appdata%\.purple) (Linux: /home/<Username>/.purple/certificates/x509/tls_peers)
  3. Delete everything in the certificate folder.
  4. Restart pid­gin and eventually you should get a new certificate that works.

P.S: Windows users who aren’t familiar with %app­data% just type %appdata%\.purple in your address bar and press enter.

Nullpointer
  • 1,191
  • 4
  • 16
  • 34
1

You can use Pidgin-developers PPA to resolve it. I installed pidgin packages and libpurple from that source and it solved my problem with accessing Lync 2013 resources. Now it can automatically allow certificates (show dialog to accept or reject unknown certificate). Have you tried that? If you used 15.04 there is also a workaround to download a few packages and replace old ones with new. I tested it on 15.04 already, it works.

poleguy
  • 175
user3417815
  • 737
  • 6
  • 15
1

I was able to get around the certificate issue by manually replacing it with a saved copy a couple of times. Stopped working after that, and upgrading to 2.11 didn't seem to help.

If you build from source, one thing to try is to modify the source code for libpurple/certificates.c ; moving the PURPLE_CERTIFICATE_FATALS_MASK check under the PURPLE_CERTIFICATE_NON_FATALS_MASK check to prompt the user but allow the certificate if accepted. Probably not the safest thing to do, but worked for me.

0

Force pidgin to download new certificates.

rm ~/.purple/certificates/x509/tls_peers/*

Close and re-open pidgin.

ls ~/.purple/certificates/x509/tls_peers/*

Now this should list newly downloaded certificates.

techraf
  • 3,316
Binoy
  • 1