Changeset 6054 for pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
- Timestamp:
- Aug 28, 2019 12:02:50 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r6053 r6054 1169 1169 /* Destroy SSL instance */ 1170 1170 if (ossock->ossl_ssl) { 1171 /**1172 * Avoid calling SSL_shutdown() if handshake wasn't completed.1173 * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an1174 * SSL handshake, while previous versions always return 0.1175 */1176 if (SSL_in_init(ossock->ossl_ssl) == 0) {1177 SSL_shutdown(ossock->ossl_ssl);1178 }1179 1171 SSL_free(ossock->ossl_ssl); /* this will also close BIOs */ 1180 1172 ossock->ossl_ssl = NULL; … … 1197 1189 static void ssl_reset_sock_state(pj_ssl_sock_t *ssock) 1198 1190 { 1191 ossl_sock_t *ossock = (ossl_sock_t *)ssock; 1192 /** 1193 * Avoid calling SSL_shutdown() if handshake wasn't completed. 1194 * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an 1195 * SSL handshake, while previous versions always return 0. 1196 */ 1197 if (ossock->ossl_ssl && SSL_in_init(ossock->ossl_ssl) == 0) { 1198 int ret = SSL_shutdown(ossock->ossl_ssl); 1199 if (ret == 0) { 1200 /* Flush data to send close notify. */ 1201 flush_circ_buf_output(ssock, &ssock->shutdown_op_key, 0, 0); 1202 } 1203 } 1204 1199 1205 pj_lock_acquire(ssock->write_mutex); 1200 1206 ssock->ssl_state = SSL_STATE_NULL;
Note: See TracChangeset
for help on using the changeset viewer.