Using "SSL_CTX_use_certificate_chain_file" instead of "SSL_CTX_use_certificate_file" 56/2856/1
authorDavid Galeano <davidgaleano@turbulenz.biz>
Thu, 10 Jan 2013 02:11:21 +0000 (10:11 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:22 +0000 (13:01 -0800)
to support server certificates signed by intermediaries.

lib/libwebsockets.c

index 2f8b453..18c780b 100644 (file)
@@ -2800,8 +2800,8 @@ libwebsocket_create_context(int port, const char *interf,
                /* openssl init for server sockets */
 
                /* set the local certificate from CertFile */
-               n = SSL_CTX_use_certificate_file(context->ssl_ctx,
-                                       ssl_cert_filepath, SSL_FILETYPE_PEM);
+               n = SSL_CTX_use_certificate_chain_file(context->ssl_ctx,
+                                       ssl_cert_filepath);
                if (n != 1) {
                        fprintf(stderr, "problem getting cert '%s': %s\n",
                                ssl_cert_filepath,