Re: Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-10 Thread Kamala Ayyar
Hello Matt, I used the same test server application to listen on the port but used the command line version for the client to connect and it connects without issue and handshake done and server certificates displayed on screen. openssl s_client -connect servername:20333 I am not sure what is the i

Re: Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-08 Thread Kamala Ayyar
Hello Matt, The socket descriptor is good and I verified using the socket directly. I do exchange data between client and server successfully before passing it the function to convert to a secure socket. It fails at the same place as the SSL_accept() with the same error from the call back functi

Re: Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-04 Thread Matt Caswell
Are you sure that the socket descriptor in "*this" is good and works? You could test that by wrapping it in a BIO like this: BIO *bio = BIO_new(BIO_s_socket()); if (bio == NULL) goto err; BIO_set_fd(bio, *this, BIO_NOCLOSE); and then attempting to read some data from it usi

Re: Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-04 Thread Kamala Ayyar
Hello Matt, I call the WSAGetLastError() for Windows and that returns 183 (ERROR_ALREADY_EXISTS) //Cannot create a file when that file already exists The SSL_get_error() gives us SSL_ERROR_SYSCALL *Server *code is roughly like below SSL_CTX *m_pCtx; SSL *m_pSsl; m_pCtx = SSL_CTX_new(TLS_server_me

Re: Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-04 Thread Matt Caswell
Does errno give you anything? How did you create your BIOs for m_pSsl? Matt On 04/02/2022 16:25, Kamala Ayyar wrote: Hello Matt, The SSL_get_error() returns 5(SSL_ERROR_SYSCALL) It does not print anything for this error, just an empty string. I use the following to print error but nothing i

Re: Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-04 Thread Kamala Ayyar
Hello Matt, The SSL_get_error() returns 5(SSL_ERROR_SYSCALL) It does not print anything for this error, just an empty string. I use the following to print error but nothing is printed if ((retVal = SSL_accept(m_pSsl)) < 1) { sslError = SSL_get_error(m_pSsl, retVal); LOGERROR(getOpenSSLError()); th

Re: Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-04 Thread Matt Caswell
On 04/02/2022 15:17, Kamala Ayyar wrote: Hello, We are facing a strange handshake failure issue with a test server and client application using OpenSSL in Windows.  We have tried with both 1.1.1g and 3.0.1 versions- same problem. We created a Dll to handle the OpenSSL functions- where the

Handshake Failure : SSL_accept:Error in before SSL initialization

2022-02-04 Thread Kamala Ayyar
Hello, We are facing a strange handshake failure issue with a test server and client application using OpenSSL in Windows. We have tried with both 1.1.1g and 3.0.1 versions- same problem. We created a Dll to handle the OpenSSL functions- where the SSL context, SSL object and certificates are hand