Skip to content

Shutdown TLS1.3 connection #2776

@micheleselea

Description

@micheleselea

I think we have to deal with SecureSocketImple::shutdown() and TLS1.3 (using for example OpenSSL 1.1.1c).
I found some strange behavior that broke connection to the end transfer if the client do not correctly close connection. Reading this I understand that we should do something more during shutdown or we can disable the session tickets sent after handshake like

#if OPENSSL_VERSION_NUMBER >= 0x1010100fL
        /* TLS 1.3 server sends session tickets after a handhake as part of
         * the SSL_accept(). If a client finishes all its job before server
         * sends the tickets, SSL_accept() fails with EPIPE errno. Since we
         * are not interested in a session resumption, we can not to send the
         * tickets. */
        /*if (1 != SSL_set_num_tickets(ssl, 0)) {
            fprintf(stderr, "SSL_set_num_tickets failed\n");
            exit(EXIT_FAILURE);
        }
        Or we can perform two-way shutdown. Client must call SSL_read() before
        the final SSL_shutdown(). */
#endif

I'm going to have some try, because I found some strange behavior for example in FTPS connection, after client sent all data and close connection the socket receive on server side throw exception.
If I find more I'll share with you

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions