Re: ssl client write / server accept seems broken

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 3/23/21 11:06 PM, Matt Caswell wrote:


On 23/03/2021 15:47, Embedded Devel wrote:
Do you know if your application is statically linked or dynamically linked to OpenSSL?
Ive attached the code in question if it helps



Looks like the original developer already tried to print the contents of the OpenSSL error stack:

        case SSL_ERROR_SSL:
            LOG(LOG_ERR, "%s: Error SSL_ERROR_SSL - return code: %d. %s\n", custom_prefix, ret_val, custom_msg);
            break;
    }

    ERR_print_errors_fp(stderr);fflush(stderr);

The errors seem to be going to "stderr" rather than via your "LOG" function. You don't show what "LOG" does but if it goes somewhere other than stderr then the errors are going somewhere different to your log file. Are you able to show us the stderr output from running your application?

logread

Tue Mar 23 16:09:43 2021 user.err : ac_ssl_client_write(): Error SSL_ERROR_SSL - return code: -1.
Tue Mar 23 16:09:44 2021 user.info : ac_send_init(): Error
Tue Mar 23 16:09:46 2021 user.err : ac_ssl_client_write(): Error SSL_ERROR_SSL - return code: -1.
Tue Mar 23 16:09:46 2021 user.info : ac_send_init(): Error
Tue Mar 23 16:09:49 2021 user.err : ac_ssl_client_write(): Error SSL_ERROR_SSL - return code: -1.
Tue Mar 23 16:09:49 2021 user.info : ac_send_init(): Error
Tue Mar 23 16:09:54 2021 user.err : ac_ssl_client_write(): Error SSL_ERROR_SSL - return code: -1.
Tue Mar 23 16:09:54 2021 user.info : ac_send_init(): Error
Tue Mar 23 16:09:59 2021 user.err : ac_ssl_client_write(): Error SSL_ERROR_SSL - return code: -1.
Tue Mar 23 16:09:59 2021 user.info : ac_send_init(): Error
Tue Mar 23 16:10:05 2021 user.err : ac_ssl_client_write(): Error SSL_ERROR_SSL - return code: -1.
Tue Mar 23 16:10:05 2021 user.info : ac_send_init(): Error

client side console

2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690: 2011704912:error:140C5042:SSL routines:ssl_undefined_function:called a function you should not call:ssl/ssl_lib.c:3690:

nothing on console / server side /var/log/message


Mar 23 17:09:54 optim04 ac_server[617182]: ac_ssl_server_accept(): Error SSL_ERROR_SYSCALL - return code: -1. SSL_accept() Mar 23 17:09:54 optim04 ac_server[617182]: ac_ssl_server_accept(): Error code: -3 Mar 23 17:09:59 optim04 ac_server[617182]: ac_ssl_server_accept(): Error SSL_ERROR_SYSCALL - return code: -1. SSL_accept() Mar 23 17:09:59 optim04 ac_server[617182]: ac_ssl_server_accept(): Error code: -3

Mar 23 17:10:05 optim04 ac_server[617182]: ac_ssl_server_accept(): Error SSL_ERROR_SYSCALL - return code: -1. SSL_accept() Mar 23 17:10:05 optim04 ac_server[617182]: ac_ssl_server_accept(): Error code: -3
[root@optim04 ~]#

just compiled with gcc, i see no -lstatic in the makefile ... ive attached the ssl .c and .h files in question if you want to see them

What does "ldd" show you for the application binary? i.e.

ldd name-of-you-binary-here

client

root@OpenWrt:~# ldd /usr/sbin/ac_client
    /lib/ld-musl-mips-sf.so.1 (0x77e20000)
    libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x77da0000)
    libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x77bc6000)
    libaxl.so.0 => /usr/lib/libaxl.so.0 (0x77b6e000)
    libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x77b4a000)
    libc.so => /lib/ld-musl-mips-sf.so.1 (0x77e20000)

server

ldd /usr/bin/ac_server
    linux-vdso.so.1 (0x00007fff2bd99000)
    libmariadb.so.3 => /lib64/libmariadb.so.3 (0x00007f9e81fbb000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f9e81d9b000)
    libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007f9e81b07000)
    libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007f9e81621000)
    libaxl.so.0 => /lib64/libaxl.so.0 (0x00007f9e813ef000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f9e8102c000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f9e80e15000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f9e80c11000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f9e8088f000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f9e82210000)



Matt



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux