-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852) #640
Comments
Hi @OdedRaiches, thanks for filing this issue. Going from the description of your setup, your self-signed certificate is probably the problem here. You likely need to get a client certificate that is signed and trusted by your server's CA. Your server doesn't recognize your self-signed certificate, causing certificate verification to fail. |
@PeterHamilton thanks for the quick reply! As a uid I pass this: Am I missing something? When I look at the 'usage' documentation I see that the key_id is built somehow but I don't understand how its got to do with the UUID that the object has (and why is it different from the demo anyway?). |
That is odd. The UUID should be what you need to fetch the key using Tweak
to
Send me the updated log output; from that I'll be able to tell if PyKMIP is sending the full UUID to the SmartKey server. Note that this will include the unencrypted encoded content for your SmartKey username and password, so if you can't share that I'll have to walk you through what specific piece of the log output I need. You can send me the log output over email if you prefer to avoid a public channel like this. |
@PeterHamilton this is the only message I get back (same as before): I also used |
Hmmm, setting logging to debug should definitely have dumped that
They should be towards the end of the buffer. Anything after those bytes should be the encoded UUID (plus some leading metadata). Send me that. |
@PeterHamilton
I put a bunch of |
Ok, so the relevant part is this segment, at the end:
The I do not know why the SmartKey server is only seeing 26 characters since PyKMIP is sending all 36. Is there a way to enable additional logging on the SmartKey server so we can see what it is receiving from the client? |
@PeterHamilton no way to see any additional logs on server side, only the dashboard with very limited logging. |
@PeterHamilton Tried on another environment and got the same error. |
@PeterHamilton
I did some debugging with gdb and saw this:
Now the server is not complaining about the UUID but something else. |
So that is an odd error. The To test this, you'll have to modify some libkmip internals. You can either set the Finally, what KMIP version is the SmartKey server using? The libkmip |
@PeterHamilton I set the
So that looks more like before. |
@PeterHamilton tried running pykmip with KMIP_2_0 and got this error: So I guess that SmartKey does not support 2.0 (?) |
@PeterHamilton I tried on all the supported version and got the same |
@OdedRaiches If the SmartKey server is returning the same error for both PyKMIP and libkmip, which are different client implementations, my gut says there's something weird with how the server is parsing the client request. Maybe it's expecting another optional field that we're not sending? Try creating a key using PyKMIP or libkmip. You should get back the UUID for your new key. Then try retrieving that key using that UUID. Maybe the UUID displayed in the web interface is not the UUID you should be using to fetch it? I won't have a ton of time today to debut this but I'm still interested to hear how the above test goes. |
@PeterHamilton I still get the same
I put |
You definitely should not be getting that error for a Create request. The server is assigning your new key a UUID and sending it back to you. If the server is parsing a UUID, it is doing something wrong. I'm going to pick through the above buffer dump to make doubly sure we're not sending anything weird to the server. |
I decoded the buffer manually to make sure there weren't any unexpected contents. I couldn't find any. This is the message that corresponds to your buffer:
This is a valid Create request. If the SmartKey server doesn't accept this, then it's either expecting an optional field that we're not sending or it's failing to parse the message properly. There's not much else I can do debug wise here. This message encoding is almost identical to some of the encodings I test against which are published in the KMIP specification testing document. One final theory - is your user allowed to create and retrieve keys? Is it possible that the Permission Error is sending back a bogus error message that's actually caused by your user account permissions? |
One final final thought - the only thing that is 26 characters in length in the request is your username. Is there a UUID for your user account that you should be using as your username instead? If there is, try that. |
@PeterHamilton
For testing purposes - the certificate can be self-signed, no need for it to be signed by a known CA. Thanks for all the help! |
@OdedRaiches No problem! Really glad to hear that you figured it out. After my debug yesterday I wondered if the credentials were the issue. I'm also happy to hear that SmartKey works correctly. If you run into any future problems with either PyKMIP or libkmip, don't hesitate to let me know. Cheers! |
I'm trying to use this library for communication with Equinix SmartKey via KMIP interface (which they say is supported).
I have this "certificate verify failed" exception but not sure what's failing on my end.
I did a self signed certificate and also tried to download the server's certificate for the "ca_certs".
This is my configuration:
I run the example in
kmip/demos/pie/get.py
and get this:The text was updated successfully, but these errors were encountered: