|Do you know where your variables are?|
NET::SSLeay to verify certificates?by LoraIlieva (Acolyte)
|on Nov 17, 2016 at 10:42 UTC ( #1176049=perlquestion: print w/replies, xml )||Need Help??|
LoraIlieva has asked for the wisdom of the Perl Monks concerning the following question:
Hi! I have the same task to do and the same problem. I am trying to verify ssl sertificate using Net::SSLeay.
As input I have certificate in PEM format and path to the directory with root and intermediate certificates. I read about doing the verification in C (https://www.ibm.com/developerworks/library/l-openssl/), but I can't find equivalents of called C functions. This is what I did:
Result is always '0' which means this is valid certificate. The problem is that I tried with both – valid and invalid certificate, and the result is always '0'.Net::SSLeay::CTX_free($ctx);
Also I read that it's not verifying the certificate, but something called x509_store, so I found other example in C (http://stackoverflow.com/questions/2756553/x509-certificate-verification-in-c). I tryed to translate it to perl:
Result is the same – always '0'.
I think the problem is somewhere in the usage of those strange data structures and 'get_verify_result' returns '0' to show me that there is an error. I don't know what I am doing wrong. Could someone help me?
Back to Seekers of Perl Wisdom