Question

Any idea how I can fix this?

>>> from M2Crypto import SSL
>>> M2Crypto.version
'0.21.1'
>>> 

>>> ctx = SSL.Context()
>>> conn = SSL.Connection(ctx)
>>> conn.connect(('cancerhelp.org.uk', 443))
Segmentation fault (core dumped)
Was it helpful?

Solution

The problem is probably that the server can't handle the default sslv23 protocol used by default by M2Crypto - at least it's part of the problem. It shouldn't segfault but give an error in this case, that's probably a bug in M2Crypto.

Try using sslv3 or tlsv1 instead:

from M2Crypto import SSL
ctx = SSL.Context(protocol='tlsv1')
conn = SSL.Connection(ctx)
conn.connect(('www.cancerhelp.org.uk', 443))

That worked for me...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top