summaryrefslogtreecommitdiffstats
path: root/apps/s_cb.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-04-11 16:54:07 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-04-11 16:54:07 +0000
commit65a0f684849b49033bb035d681b46f96f128f84b (patch)
tree3d6b8da6299fae0711daeb3f026d5c3c1b6e898e /apps/s_cb.c
parente1a7db8fdd2f91367d1ef3253424701c138927c6 (diff)
Add options to set additional type specific certificate chains to
s_server.
Diffstat (limited to 'apps/s_cb.c')
-rw-r--r--apps/s_cb.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/s_cb.c b/apps/s_cb.c
index 4395f194aa..b21a4283df 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -250,7 +250,8 @@ int set_cert_stuff(SSL_CTX *ctx, char *cert_file, char *key_file)
return(1);
}
-int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key)
+int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key,
+ STACK_OF(X509) *chain)
{
if (cert == NULL)
return 1;
@@ -275,6 +276,12 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key)
BIO_printf(bio_err,"Private key does not match the certificate public key\n");
return 0;
}
+ if (chain && !SSL_CTX_set1_chain(ctx, chain))
+ {
+ BIO_printf(bio_err,"error setting certificate chain\n");
+ ERR_print_errors(bio_err);
+ return 0;
+ }
return 1;
}