@@ -257,12 +257,6 @@ using socket_t = int;
257
257
#error Sorry, OpenSSL versions prior to 1.1.1 are not supported
258
258
#endif
259
259
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
266
260
#endif
267
261
268
262
#ifdef CPPHTTPLIB_ZLIB_SUPPORT
@@ -7313,55 +7307,12 @@ process_client_socket_ssl(SSL *ssl, socket_t sock, time_t read_timeout_sec,
7313
7307
return callback (strm);
7314
7308
}
7315
7309
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
-
7343
7310
class SSLInit {
7344
7311
public:
7345
7312
SSLInit () {
7346
- #if OPENSSL_VERSION_NUMBER < 0x1010001fL
7347
- SSL_load_error_strings ();
7348
- SSL_library_init ();
7349
- #else
7350
7313
OPENSSL_init_ssl (
7351
7314
OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL );
7352
- #endif
7353
7315
}
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
7365
7316
};
7366
7317
7367
7318
// SSL socket stream implementation
0 commit comments