forked from cory/tildefriends
Now this OpenSSL use is perfect.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4829 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
6765254f43
commit
eb5da26004
@ -46,14 +46,14 @@ bool tf_tls_context_set_certificate(tf_tls_context_t* context, const char* certi
|
|||||||
BIO_puts(bio, certificate);
|
BIO_puts(bio, certificate);
|
||||||
X509* x509 = PEM_read_bio_X509(bio, 0, 0, 0);
|
X509* x509 = PEM_read_bio_X509(bio, 0, 0, 0);
|
||||||
result = SSL_CTX_use_certificate(context->context, x509);
|
result = SSL_CTX_use_certificate(context->context, x509);
|
||||||
//X509_free(x509);
|
X509_free(x509);
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
x509 = PEM_read_bio_X509(bio, 0, 0, 0);
|
x509 = PEM_read_bio_X509(bio, 0, 0, 0);
|
||||||
if (x509)
|
if (x509)
|
||||||
{
|
{
|
||||||
SSL_CTX_add_extra_chain_cert(context->context, x509);
|
SSL_CTX_add_extra_chain_cert(context->context, x509);
|
||||||
//X509_free(x509);
|
/* Docs say don't x509_free: https://www.openssl.org/docs/man3.2/man3/SSL_CTX_add_extra_chain_cert.html. */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user