]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl.h: avoid including OpenSSL headers here
authorDaniel Stenberg <daniel@haxx.se>
Sat, 8 Jan 2022 09:40:21 +0000 (10:40 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 8 Jan 2022 13:39:12 +0000 (14:39 +0100)
... by instead using the struct version of the typedef'ed pointer. To
fix build errors when both Schannel and OpenSSL are enabled.

Fixes #8240
Reported-by: Jan Ehrhardt
Closes #8246

lib/vtls/openssl.h

index 28058453c0b37ec2ca9174862723e9e6fbb8b54d..7df642bc9a3e62f3540845254e93d1ee430da3a2 100644 (file)
@@ -7,7 +7,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2022, Daniel Stenberg, <daniel@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
  * and ngtcp2.c
  */
 
-#include <openssl/x509v3.h>
 #include "urldata.h"
 
+/*
+ * In an effort to avoid using 'X509 *' here, we instead use the struct
+ * x509_st version of the type so that we can forward-declare it here without
+ * having to include <openssl/x509v3.h>. Including that header causes name
+ * conflicts when libcurl is built with both Schannel and OpenSSL support.
+ */
+struct x509_st;
 CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn,
-                              X509 *server_cert);
+                              struct x509_st *server_cert);
 extern const struct Curl_ssl Curl_ssl_openssl;
 
 #endif /* USE_OPENSSL */