diff --git a/deps/oblib/src/lib/ssl/ob_ssl_config.cpp b/deps/oblib/src/lib/ssl/ob_ssl_config.cpp index ec94cf108..cc4eaa9b3 100644 --- a/deps/oblib/src/lib/ssl/ob_ssl_config.cpp +++ b/deps/oblib/src/lib/ssl/ob_ssl_config.cpp @@ -420,7 +420,10 @@ static SSL_CTX* ob_ssl_create_ssl_ctx(const ObSSLConfig& ssl_config) SSL_CTX_set_options(ctx, SSL_OP_TLS_BLOCK_PADDING_BUG); SSL_CTX_set_options(ctx, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS); SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE); - SSL_CTX_set_read_ahead(ctx, 1); + /*set_read_ahead may cause the first application data that been sent after + * SSL handshake being unprocessed, forbid it. + */ + SSL_CTX_set_read_ahead(ctx, 0); } return ctx; } diff --git a/deps/ussl-hook/ssl/ssl_config.c b/deps/ussl-hook/ssl/ssl_config.c index efabaf441..bb1f793d4 100644 --- a/deps/ussl-hook/ssl/ssl_config.c +++ b/deps/ussl-hook/ssl/ssl_config.c @@ -475,7 +475,10 @@ static SSL_CTX *ob_ssl_create_ssl_ctx(const ssl_config_item_t *ssl_config, int t SSL_CTX_set_options(ctx, SSL_OP_TLS_BLOCK_PADDING_BUG); SSL_CTX_set_options(ctx, SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS); SSL_CTX_set_options(ctx, SSL_OP_SINGLE_DH_USE); - SSL_CTX_set_read_ahead(ctx, 1); + /*set_read_ahead may cause the first application data that been sent after + * SSL handshake being unprocessed, forbid it. + */ + SSL_CTX_set_read_ahead(ctx, 0); } if (0 != ret) { SSL_CTX_free(ctx);