Topic: [SOLVED] Simultaneous operation as both server and client?

I have an application that includes an embedded webserver and want it to periodically check another server for updated data by runnning as a client. I integrated a version of the wolfSSL client example (which works fine as a stand-alone application) with my server and created CTX and SSL objects dedicated to client operations. When I run it the application the server, which is set up first, works fine but when I run the client I get this:

wolfSSL Entering SSLv23_client_method_ex
wolfSSL Entering wolfSSL_CTX_new_ex
wolfSSL Entering wolfSSL_CertManagerNew
wolfSSL Leaving WOLFSSL_CTX_new, return 0
wolfSSL Entering wolfSSL_CTX_set_verify
Connected to 192.168.1.76
wolfSSL Entering SSL_new
wolfSSL Leaving SSL_new, return 0
wolfSSL Entering SSL_connect()
wolfSSL error occurred, error = -344
wolfSSL Entering SSL_get_error
wolfSSL Leaving SSL_get_error, return -344
wolfSSL Entering ERR_error_string
TLS Connect Error: wrong client/server type
SSL version is wolfSSL Entering wolfSSL_get_version
TLSv1.3
wolfSSL Entering wolfSSL_get_cipher
wolfSSL Entering SSL_get_current_cipher
wolfSSL Entering wolfSSL_CIPHER_get_name
SSL cipher suite is NONE
wolfSSL Entering SSL_write()
handshake not complete, trying to finish
wolfSSL Entering wolfSSL_negotiate
wolfSSL Entering SSL_accept_TLSv13()
ProcessReply retry in error state, not allowed
wolfSSL error occurred, error = -344
wolfSSL Leaving wolfSSL_negotiate, return -1
wolfSSL Leaving SSL_write(), return -1
wolfSSL Entering SSL_get_error
wolfSSL Leaving SSL_get_error, return -344
wolfSSL Entering ERR_error_string
TLS Write Error: wrong client/server type
wolfSSL Entering SSL_shutdown()
growing output buffer

wolfSSL error occurred, error = -308
wolfSSL Entering SSL_free
CTX ref count not 0 yet, no free
Shrinking output buffer

Is this not a supported mode of operation?

Share

Re: [SOLVED] Simultaneous operation as both server and client?

Hi bsda_dev,

Your error is: `SIDE_ERROR                   = -344,   /* wrong client/server type */`.

Yes we support both sides. We do have a feature to create a generic WOLFSSL_CTX method and the context role (client or server) is determined on the first connect.

To enable this feature use the build option `WOLFSSL_EITHER_SIDE` and use the method `wolfSSLv23_method`.

Thanks,
David Garske, wolfSSL

Share

Re: [SOLVED] Simultaneous operation as both server and client?

Thanks. Looks like that's working for me.

Share