Skip to content

Commit

Permalink
tests: lightly interrogate SSL_CTX_get_cert_store
Browse files Browse the repository at this point in the history
  • Loading branch information
cpu committed Apr 3, 2024
1 parent d18afea commit 0808ad5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rustls-libssl/tests/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ int main(int argc, char **argv) {
}
TRACE(SSL_CTX_set_alpn_protos(ctx, (const uint8_t *)"\x02hi\x05world", 9));
dump_openssl_error_stack();

X509_STORE *root_store = SSL_CTX_get_cert_store(ctx);
assert(root_store != NULL);
STACK_OF(X509) *root_certs = X509_STORE_get1_all_certs(root_store);
if (root_certs) {
printf("X509_STORE: %d cert(s)\n", sk_X509_num(root_certs));
} else {
printf("X509_STORE: empty\n");
}

SSL *ssl = SSL_new(ctx);
dump_openssl_error_stack();
TRACE(SSL_set1_host(ssl, host));
Expand Down

0 comments on commit 0808ad5

Please sign in to comment.