Changeset 5648


Ignore:
Timestamp:
Sep 14, 2017 5:03:45 AM (7 years ago)
Author:
riza
Message:

Re #1994(misc): Avoid calling SSL_shutdown() if handshake wasn't completed otherwise OpenSSL 1.0.2f and newer version will complain. Thanks to Peter Koletzki for the report.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c

    r5635 r5648  
    10711071    /* Destroy SSL instance */ 
    10721072    if (ssock->ossl_ssl) { 
    1073         SSL_shutdown(ssock->ossl_ssl); 
     1073        /** 
     1074         * Avoid calling SSL_shutdown() if handshake wasn't completed. 
     1075         * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an 
     1076         * SSL handshake, while previous versions always return 0.        
     1077         */ 
     1078        if (SSL_in_init(ssock->ossl_ssl) == 0) { 
     1079            SSL_shutdown(ssock->ossl_ssl); 
     1080        }        
    10741081        SSL_free(ssock->ossl_ssl); /* this will also close BIOs */ 
    10751082        ssock->ossl_ssl = NULL; 
Note: See TracChangeset for help on using the changeset viewer.