Hi Jarl,
I am using openssl with RCF but at times my program gives an exception in retryreadwrite method inOpenSslEncryptionFilter class but without giving any reason.
"Exception : OpenSSL error: %1"
Why this unnamed exception and what causes it?
[OPENSSL] BIO_read fails
Re: [OPENSSL] BIO_read fails
Are you able to reproduce this error? If so, if you put a breakpoint in this code in OpenSslEncryptionFilter.cpp:
, you can then step through getOpenSslErrors() , and see if you can figure out what's going on. From your error message, it looks like getOpenSslErrors() is returning an empty string, which may in turn be caused by a failure in the OpenSSL ERR_get_errors() function.
Code: Select all
else
{
mErr = -1;
std::string opensslErrors = getOpenSslErrors();
Exception e( _RcfError_OpenSslError(opensslErrors) );
RCF_THROW(e);
}
-
- Posts: 4
- Joined: Mon Jan 20, 2014 5:27 am
Re: [OPENSSL] BIO_read fails
Hi Jarl,
Yes I am able to reproduce this error at random times.
I have tried debugging it also and the failure happens in ERR_print_errors method.
I am using android with libcrypto_static.a,libssl_static.a static libs.
If you have any idea why this failure happens in printing the error causing an unnamed error to be thrown, please share with me.
Thanks,
Akhilesh
Yes I am able to reproduce this error at random times.
I have tried debugging it also and the failure happens in ERR_print_errors method.
I am using android with libcrypto_static.a,libssl_static.a static libs.
If you have any idea why this failure happens in printing the error causing an unnamed error to be thrown, please share with me.
Thanks,
Akhilesh
Re: [OPENSSL] BIO_read fails
Hi Akhilesh,
It looks like for some reason, the code in this situation is unable to extract a meaningful error message from OpenSSL.
One thing you can try, is to periodically disconnect the RcfClient<>:
This will close the TCP connection and dispose of the OpenSSL state that is associated with it. On the next remote call you make, a new TCP connection is established and the OpenSSL state will be re-created. It's possible that this will help to avoid the error happening in the first place.
It looks like for some reason, the code in this situation is unable to extract a meaningful error message from OpenSSL.
One thing you can try, is to periodically disconnect the RcfClient<>:
Code: Select all
RcfClient<I_Echo> client( ... );
client.getClientStub().disconnect();
Re: [OPENSSL] BIO_read fails
Hi Akhilesh,
Can you share ur libcrypto_static.a,libssl_static.a static libs and ur Android.mk setting with me, I can't link it with openssl support!
Millions of thanx!
Can you share ur libcrypto_static.a,libssl_static.a static libs and ur Android.mk setting with me, I can't link it with openssl support!
Millions of thanx!