oatpp / oatpp-openssl

OpenSSL adaptor for Oat++ applications
https://oatpp.io/
Apache License 2.0
13 stars 22 forks source link

Exception at ssl connection - core dump #27

Closed SamTailor13 closed 3 weeks ago

SamTailor13 commented 3 weeks ago

Hi Leonid,

I have enabled the SSL using oatpp-openssl (1.3.0) in our application server. Now if we make a rest call using https then it is running fine but if we accidently uses http , our application is generating core-dump with below console log:-

|2024-06-13 18:19:50 1718295590358211| [oatpp::openssl::Connection::ConnectionContext::init()]:140607522850560:error:1408F09C:SSL routines:ssl3_get_record:http request:ssl/record/ssl3_record.c:322: terminate called after throwing an instance of 'std::runtime_error' what(): [oatpp::openssl::Connection::ConnectionContext::init()]: Error. Handshake failed.

Aborted (core dumped)

How may we prevent to crash and handle properly this exception ?

Thanks in advance for your support -Sam

lganzzzo commented 3 weeks ago

Hello @SamTailor13 ,

Please use 1.3.0-latest tag for all oatpp modules.

[oatpp::openssl::Connection::ConnectionContext::init()]:140607522850560:error:1408F09C:SSL routines:ssl3_get_record:http request:ssl/record/ssl3_record.c:322:
terminate called after throwing an instance of 'std::runtime_error'
what(): [oatpp::openssl::Connection::ConnectionContext::init()]: Error. Handshake failed.

This error is not thrown any-more. instead we just ignore handshake failure and close connection.

SamTailor13 commented 3 weeks ago

Hi Leonid

Thanks so much. Very clear. I tested it. Work as you described.

Have a good day. -Sam