Replies: 5 comments
-
The SSL_new(SSL_CTX *ctx): SSL_CTX_free() So, you may want to call Here's a demo file for reference. |
Beta Was this translation helpful? Give feedback.
-
As per example and your kind explanation, I changed sequence to SSL_free() and then SSL_CTX_free. But still I got same error at the same line of code. I am using SSL as client, I connect only once and then use that connection to send multiple requests, I keep open the same connection until I release the SSL for exiting the program. Please suggest. |
Beta Was this translation helpful? Give feedback.
-
In your example in the client code (branch at line no. 347 in main.c), if SSL_connect fails then we go to SSL_shutdown() while the man pages says that is SSL_connect returns value != 1, then either shutdown was controlled (value = 0) or shutdow was not clean(value<0). This means there was already a shutdow, then why we call the ssl_shutdown() again?
The following return values can occur: 0
1
<0
|
Beta Was this translation helpful? Give feedback.
-
After digging deep I found that SSL_shutdown() returns this error: if I get an error in SSL_shutdown, should I try to SSL_free() and SSL_context_free(), because it gives SIGSEGV in my case. |
Beta Was this translation helpful? Give feedback.
-
Do not call SSL_clear(), this is unneeded and might be causing this. |
Beta Was this translation helpful? Give feedback.
-
Recently I got the following interrupt from my C program which is also given below:
I don't have detailed understanding about SSL over the time I found this code for safely release resources of SSL and it works
if everything goes right but when there is no connection with host then this gives error very often:
Is this correct sequence to free resources or I am doing something wrong because I don't know internals?
If it is right, then what can we do to avoid such faults?
Beta Was this translation helpful? Give feedback.
All reactions