Skip to content

Commit 9f512ac

Browse files
committed
Removed code for upsupported OpenSSL
1 parent c0b461a commit 9f512ac

File tree

1 file changed

+0
-49
lines changed

1 file changed

+0
-49
lines changed

httplib.h

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,6 @@ using socket_t = int;
257257
#error Sorry, OpenSSL versions prior to 1.1.1 are not supported
258258
#endif
259259

260-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
261-
#include <openssl/crypto.h>
262-
inline const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *asn1) {
263-
return M_ASN1_STRING_data(asn1);
264-
}
265-
#endif
266260
#endif
267261

268262
#ifdef CPPHTTPLIB_ZLIB_SUPPORT
@@ -7313,55 +7307,12 @@ process_client_socket_ssl(SSL *ssl, socket_t sock, time_t read_timeout_sec,
73137307
return callback(strm);
73147308
}
73157309

7316-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
7317-
static std::shared_ptr<std::vector<std::mutex>> openSSL_locks_;
7318-
7319-
class SSLThreadLocks {
7320-
public:
7321-
SSLThreadLocks() {
7322-
openSSL_locks_ =
7323-
std::make_shared<std::vector<std::mutex>>(CRYPTO_num_locks());
7324-
CRYPTO_set_locking_callback(locking_callback);
7325-
}
7326-
7327-
~SSLThreadLocks() { CRYPTO_set_locking_callback(nullptr); }
7328-
7329-
private:
7330-
static void locking_callback(int mode, int type, const char * /*file*/,
7331-
int /*line*/) {
7332-
auto &lk = (*openSSL_locks_)[static_cast<size_t>(type)];
7333-
if (mode & CRYPTO_LOCK) {
7334-
lk.lock();
7335-
} else {
7336-
lk.unlock();
7337-
}
7338-
}
7339-
};
7340-
7341-
#endif
7342-
73437310
class SSLInit {
73447311
public:
73457312
SSLInit() {
7346-
#if OPENSSL_VERSION_NUMBER < 0x1010001fL
7347-
SSL_load_error_strings();
7348-
SSL_library_init();
7349-
#else
73507313
OPENSSL_init_ssl(
73517314
OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
7352-
#endif
73537315
}
7354-
7355-
~SSLInit() {
7356-
#if OPENSSL_VERSION_NUMBER < 0x1010001fL
7357-
ERR_free_strings();
7358-
#endif
7359-
}
7360-
7361-
private:
7362-
#if OPENSSL_VERSION_NUMBER < 0x10100000L
7363-
SSLThreadLocks thread_init_;
7364-
#endif
73657316
};
73667317

73677318
// SSL socket stream implementation

0 commit comments

Comments
 (0)