mirror of
https://github.com/curl/curl.git
synced 2026-05-30 04:27:30 +03:00
openssl: call SSL_get_error() with proper error
The error function should be called with the return code from the previous call to SSL_shutdown() as argument. Closes #18872
This commit is contained in:
parent
db98daab05
commit
e7a5184fa1
1 changed files with 4 additions and 2 deletions
|
|
@ -2169,14 +2169,16 @@ static CURLcode ossl_shutdown(struct Curl_cfilter *cf,
|
|||
/* SSL should now have started the shutdown from our side. Since it
|
||||
* was not complete, we are lacking the close notify from the server. */
|
||||
if(send_shutdown && !(SSL_get_shutdown(octx->ssl) & SSL_SENT_SHUTDOWN)) {
|
||||
int rc;
|
||||
ERR_clear_error();
|
||||
CURL_TRC_CF(data, cf, "send SSL close notify");
|
||||
if(SSL_shutdown(octx->ssl) == 1) {
|
||||
rc = SSL_shutdown(octx->ssl);
|
||||
if(rc == 1) {
|
||||
CURL_TRC_CF(data, cf, "SSL shutdown finished");
|
||||
*done = TRUE;
|
||||
goto out;
|
||||
}
|
||||
if(SSL_ERROR_WANT_WRITE == SSL_get_error(octx->ssl, nread)) {
|
||||
if(SSL_ERROR_WANT_WRITE == SSL_get_error(octx->ssl, rc)) {
|
||||
CURL_TRC_CF(data, cf, "SSL shutdown still wants to send");
|
||||
connssl->io_need = CURL_SSL_IO_NEED_SEND;
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue