[Answered ]-Pythons M2Crypto raises exception in ssl_ctx_load_verify_locations when loading certificates

2👍

Just worked it out!

The load_verify_locations() function is expecting a string object, not a unicode object.

Django uses unicode by default, so the certificate path needs to be converted to a string before passed into load_verify_locations(). So:

ctx.load_verify_locations(str(m.ca_file))

Leave a comment