Browse Source

Defined OPENSSL_API_COMPAT to prevent OpenSSL 3 deprecation warnings

Paul-Louis Ageneau 2 years ago
parent
commit
d445439488
2 changed files with 13 additions and 1 deletions
  1. 9 1
      src/impl/sha.cpp
  2. 4 0
      src/impl/tls.hpp

+ 9 - 1
src/impl/sha.cpp

@@ -21,9 +21,17 @@
 #if RTC_ENABLE_WEBSOCKET
 
 #if USE_GNUTLS
+
 #include <nettle/sha1.h>
-#else
+
+#else // USE_GNUTLS==0
+
+#ifndef OPENSSL_API_COMPAT
+#define OPENSSL_API_COMPAT 0x10100000L
+#endif
+
 #include <openssl/sha.h>
+
 #endif
 
 namespace rtc::impl {

+ 4 - 0
src/impl/tls.hpp

@@ -53,6 +53,10 @@ gnutls_datum_t make_datum(char *data, size_t size);
 #include <winsock2.h>
 #endif
 
+#ifndef OPENSSL_API_COMPAT
+#define OPENSSL_API_COMPAT 0x10100000L
+#endif
+
 #include <openssl/ssl.h>
 
 #include <openssl/bio.h>