GithubHelp home page GithubHelp logo

Comments (5)

agentzh avatar agentzh commented on July 28, 2024

@hamishforbes Thanks for the report!

Will you contribute a patch for it? It seems that we just need to clear the cached SSL error in OpenSSL by calling ngx_ssl_clear_error() on the C land.

from lua-resty-core.

hamishforbes avatar hamishforbes commented on July 28, 2024

Hmm, ok this might be pushing the boundaries of my C and nginx internals knowledge.

It looks like ngx_ssl_clear_error() needs the current current request.
There was just recently a change to remove that requirement from the pem_to_der functions and it doesn't make sense that you'd need the request to convert certs.

How do you feel about having a separate function on the C side to clear the ssl error from the current request, e.g. ngx_http_lua_ffi_ssl_clear_error()
Then on the Lua side in resty-core we can check if the pem_to_der function has been called in a request or at init and call ngx_http_lua_ffi_ssl_clear_error() if required?

from lua-resty-core.

hamishforbes avatar hamishforbes commented on July 28, 2024

Oh actually, looking closer ngx_ssl_clear_error only needs the current request so it can write to the debug log.

Should we actually just directly call the OpenSSL ERR_clear_error function instead?

I've tested that out on my side and it fixes my test case.

from lua-resty-core.

agentzh avatar agentzh commented on July 28, 2024

@hamishforbes We don't need the logging part. We can duplicate the body of ngx_ssl_clear_error without logging in the C implementation of the pem_to_der() function and alike.

from lua-resty-core.

hamishforbes avatar hamishforbes commented on July 28, 2024

Hi,
I submitted a PR to the ngx_lua repo so we can probably close this issue, unless you'd like tests for the problem on resty-core as well?

from lua-resty-core.

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.