Skip to content
This repository has been archived by the owner on Feb 19, 2020. It is now read-only.

unable to have ssl_invalid_cert event handler called #469

Open
cyberswordman opened this issue Oct 1, 2017 · 3 comments
Open

unable to have ssl_invalid_cert event handler called #469

cyberswordman opened this issue Oct 1, 2017 · 3 comments

Comments

@cyberswordman
Copy link

SleekXMPP version: 1.3.3
python 2.7.13 (really winpython 2.7.13)

I'm trying to work with the send_client example.
Trying to connect with a public jabber server (007jabber.com), which uses connection encryption.
I get reports from normal jabber clients that the certificate for the server is bad, but I can still connect to it with them (pidgin and Gajim).
When connecting to it using SleekXMPP, the connection is refused:

SendMsgBot init start
DEBUG Loaded Plugin: RFC 6120: Stream Feature: STARTTLS
DEBUG Loaded Plugin: RFC 6120: Stream Feature: Resource Binding
DEBUG Loaded Plugin: RFC 3920: Stream Feature: Start Session
DEBUG Loaded Plugin: RFC 6121: Stream Feature: Roster Versioning
DEBUG Loaded Plugin: RFC 6121: Stream Feature: Subscription Pre-Approval
DEBUG Loaded Plugin: RFC 6120: Stream Feature: SASL
SendMsgBot init end
DEBUG Loaded Plugin: XEP-0030: Service Discovery
DEBUG Loaded Plugin: XEP-0199: XMPP Ping
Connecting...
DEBUG DNS: Querying 007jabber.com for AAAA records.
DEBUG DNS: Error retreiving AAAA address info for 007jabber.com.
DEBUG DNS: Querying 007jabber.com for A records.
DEBUG Socket Wrapped for SSL
DEBUG Connecting to 43.231.234.102:5222
ERROR CERT: Invalid certificate trust chain.
Unable to connect.
doTest end

I implemented the method to catch the event

#def discard(self, event):
def discard(self, event, cert, direct):
    print("Handling invalid certificate")
    return

(tried both the variants fo the definition)

and registered it into the init:

self.add_event_handler("ssl_invalid_cert", self.discard)

but no matter what, the event handler is never called (the appended log is taken in this condition)

@ammgws
Copy link

ammgws commented Nov 9, 2017

Have you tried attaching it to ssl_invalid_chain instead of ssl_invalid_cert?

@Neustradamus
Copy link

Have you tried with 1.3.2?

@Neustradamus
Copy link

@cyberswordman @ammgws: Any news?

Have you tested with "master"?

It works?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants