]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
OpenSSL: Read certificate chain from server_cert file
authorMaciej Szmigiero <mhej@o2.pl>
Sat, 19 Nov 2011 10:06:59 +0000 (12:06 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 19 Nov 2011 10:06:59 +0000 (12:06 +0200)
Currently OpenSSL implementation of TLS in hostapd loads only top
certificate in server certificate file. Change this to try to the
whole chain first and only if that fails, revert to old behavior.

Signed-off-by: Maciej Szmigiero <mhej@o2.pl>
src/crypto/tls_openssl.c

index 6380ce007275e25ef01a5b1aa4cb0a1de2adb1b8..837409669f0565176a3d1fb895f283e3bbccae82 100644 (file)
@@ -1663,6 +1663,7 @@ static int tls_global_client_cert(SSL_CTX *ssl_ctx, const char *client_cert)
 
        if (SSL_CTX_use_certificate_file(ssl_ctx, client_cert,
                                         SSL_FILETYPE_ASN1) != 1 &&
+           SSL_CTX_use_certificate_chain_file(ssl_ctx, client_cert) != 1 &&
            SSL_CTX_use_certificate_file(ssl_ctx, client_cert,
                                         SSL_FILETYPE_PEM) != 1) {
                tls_show_errors(MSG_INFO, __func__,