Add support for MYSQL_OPT_SSL_VERIFY_SERVER_CERT#100
Add support for MYSQL_OPT_SSL_VERIFY_SERVER_CERT#100jfritcher wants to merge 1 commit intofarcepest:masterfrom
Conversation
Add option to allow Python code to enable verification of the server's hostname against the name in its certificate.
|
+1 That said, I was testing this up using a preload library and still, regardless of what I specify for the trusted CA path, it succeeds... I'm not sure if the library still reads the system CA path (but I have to specify it anyway to get SSL to work) or just don't verify anything. I have no key or cert on the client, just the trusted roots (and FWIW this works only with the MariaDB client libs, which I have to preload as my Python libs are still compiled against an older MySQL version - MySSQL 5.5 vs MariaDB 10.0...) |
|
Meh! I could've just tested using a different server name. Indeed using LD_PRELOAD makes the check effective, so although needed to enable ssl In the mean time I cleaned my code; you can use this to get your client to verify certificates: |
Add option to allow Python code to enable verification of the server's
hostname against the name in its certificate.
For those who want to do hostname validation against their database, this is the only usable method for doing so.
I originally found a request to add this functionality on SourceForge, but it appears to have been ignored before the move to GitHub, so I cleaned up the original patch and am resubmitting it here as a PR.