Code Monkey home page Code Monkey logo

Comments (4)

alex-lt-kong avatar alex-lt-kong commented on May 23, 2024 1

Thanks for the update. Let me mark this as closed now.

from oatpp.

lganzzzo avatar lganzzzo commented on May 23, 2024

Hello @alex-lt-kong ,

This throw war introduced in the latest commit - oatpp/oatpp-openssl@55cf90b#diff-154b6b83b07306666e4b4cd5ef5e173c72e54cad2432d8ee68ae39a0a1778a9cR71

Before we were just ignoring handshake failure.
Actually, I don't really think it is an error - not a fatal one for sure.

However, it's strange that your program crashes...
Is it a client program that you are running? Like you are trying to connect to remote server, handshake fails, and program crashes?

The easiest way would be to wrap this call with try-catch block.
However, I'm thinking if we need to throw and log this event at all.

from oatpp.

alex-lt-kong avatar alex-lt-kong commented on May 23, 2024

Hi @lganzzzo ,

My program is an http service, not client, with SSL enabled. Regarding try-catch, usually my code in controller is executed in a sort-of callback manner, I actually have no idea where to add try-catch--and thus the subject of this issue.

ICYW, this is the entry point of Oatpp in my program, can you tell me where I should put a try-catch to catch the above-mentioned exception?

Let me also add my two cents to the throw war: my personal preference is that, as an HTTP framework, exceptions should only be propagated up to user's code in a few extreme cases. For example, port being occupied and memory allocation failure, where all hope to keep the service running is lost; otherwise users may prefer having the service running and let these exceptions be logged/returned to client (i.e., status code 500).

from oatpp.

lganzzzo avatar lganzzzo commented on May 23, 2024

Hello @alex-lt-kong ,

This issue was fixes. Please checkout the latest oatpp-openssl master.

Let me also add my two cents to the throw war: my personal preference is that, as an HTTP framework, exceptions should only be propagated up to user's code in a few extreme cases. For example, port being occupied and memory allocation failure, where all hope to keep the service running is lost; otherwise users may prefer having the service running and let these exceptions be logged/returned to client (i.e., status code 500).

I agree 100%.
This bug was introduced by adding unnecessary throw in oatpp-openssl connection handshake.
And it appears that connection stream context initialization (handshake in case of oatpp-openssl connection) isn't protected with try-catch here

As further steps we'll have to add a better top-level error handling inside oatpp itself.

from oatpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.