Add SSL_CTX_set1_cert_store()
[openssl.git] / ssl / ssl_lib.c
index 27a16ef6f4800ab51446828d3bd328fcd5c1f357..8bf872beec09ea6fd1de0f5dddaf0d8486a1fb23 100644 (file)
@@ -795,7 +795,7 @@ void SSL_set_hostflags(SSL *s, unsigned int flags)
     X509_VERIFY_PARAM_set_hostflags(s->param, flags);
 }
 
-const char *SSL_get0_peername(const SSL *s)
+const char *SSL_get0_peername(SSL *s)
 {
     return X509_VERIFY_PARAM_get0_peername(s->param);
 }
@@ -3553,6 +3553,13 @@ void SSL_CTX_set_cert_store(SSL_CTX *ctx, X509_STORE *store)
     ctx->cert_store = store;
 }
 
+void SSL_CTX_set1_cert_store(SSL_CTX *ctx, X509_STORE *store)
+{
+    if (store != NULL)
+        X509_STORE_up_ref(store);
+    SSL_CTX_set_cert_store(ctx, store);
+}
+
 int SSL_want(const SSL *s)
 {
     return (s->rwstate);