On Mon, Jul 09, 2001 at 05:23:01PM -0400, Shane Titus wrote:
> If anyone can help me, it would be greatly appreciated. I am trying to take the
>peer certificate passed from the server:
>
> peer = SSL_get_peer_certificate(ssl);
>
> // if I have received a certificate chain
> // I use the deepest certificate in the chain
>
> if (peer_chn = SSL_get_peer_cert_chain(s_ctx->ssl))
> {
> got_a_chain = 1;
> }
>
> ...
>
> if (got_a_chain && ((CAindex = sk_X509_num(peer_chn)-1) > 0))
> {
> peer = X509_dup( sk_X509_value(peer_chn,CAindex) );
> }
>
> and encode it and save it to my hashed directory of stored certificates. I am
>encoding and hashing the name correctly but when it is time to retrieve the stored
>certificate I am receiving an error of 21 (the leaf certificate can't be verified).
>If I trace into x509_vfy it looks as though I need a self-signed certificate. The
>certificate that is stored is not self-signed - it is ultimately the same certificate
>that I am receiving again. Am I trying to store the wrong thing? If so, does anyone
>know what I should be storing? Any ideas would help a lot. Thank you,
(Please break long lines)
The built-in verification engine only successfully verifies certificate
chains that end in a root certificate. Root certificates are self signed.
The root certificate must be available in the local store of trusted
certificates. Your problem may be, that the RFC allows to send incomplete
chains (root CA certificate missing), since for successfull verification
a local copy must be available anyway, so it may not always be possible
to retrieve the root certificate from the chain sent by the peer.
Best regards,
Lutz
--
Lutz Jaenicke [EMAIL PROTECTED]
BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]