diff options
| author | 2019-09-27 10:18:04 +0200 | |
|---|---|---|
| committer | 2019-09-28 12:12:23 +0200 | |
| commit | e88fdf99f943c9523ed9f1d30c940804ad99d7de (patch) | |
| tree | 23f3f1396abf7a2ceb41c9a40c48d8167bcaaa87 /src/idevice.c | |
| parent | 8c7321b11512cc3cfd112ad2b4b65c5a81e12bba (diff) | |
| download | libimobiledevice-e88fdf99f943c9523ed9f1d30c940804ad99d7de.tar.gz libimobiledevice-e88fdf99f943c9523ed9f1d30c940804ad99d7de.tar.bz2 | |
idevice: fix hang in SSL_shutdown
Diffstat (limited to 'src/idevice.c')
| -rw-r--r-- | src/idevice.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/idevice.c b/src/idevice.c index fd1f4b5..90b531d 100644 --- a/src/idevice.c +++ b/src/idevice.c | |||
| @@ -930,7 +930,13 @@ LIBIMOBILEDEVICE_API idevice_error_t idevice_connection_disable_ssl(idevice_conn | |||
| 930 | if (connection->ssl_data->session) { | 930 | if (connection->ssl_data->session) { |
| 931 | /* see: https://www.openssl.org/docs/ssl/SSL_shutdown.html#RETURN_VALUES */ | 931 | /* see: https://www.openssl.org/docs/ssl/SSL_shutdown.html#RETURN_VALUES */ |
| 932 | if (SSL_shutdown(connection->ssl_data->session) == 0) { | 932 | if (SSL_shutdown(connection->ssl_data->session) == 0) { |
| 933 | SSL_shutdown(connection->ssl_data->session); | 933 | /* Only try bidirectional shutdown if we know it can complete */ |
| 934 | int ssl_error; | ||
| 935 | if ((ssl_error = SSL_get_error(connection->ssl_data->session, 0)) == SSL_ERROR_NONE) { | ||
| 936 | SSL_shutdown(connection->ssl_data->session); | ||
| 937 | } else { | ||
| 938 | debug_info("Skipping bidirectional SSL shutdown. SSL error code: %i\n", ssl_error); | ||
| 939 | } | ||
| 934 | } | 940 | } |
| 935 | } | 941 | } |
| 936 | #else | 942 | #else |
