Git Product home page Git Product logo

Comments (4)

fffonion avatar fffonion commented on August 29, 2024

@catbro666 It will make more sense to let user to control the flag if we are working on a much low-level API (for example, a one-to-one wrapping of X509_STORE openssl api into Lua). But most of the functions in this library are designed to use by end user, in this case it's better to keep the API as simple as possible. Asking user had to call two API for CRL check but only one for trusted chain is inbalanced.

I do see the use case from mtls-auth plugin, but generally speaking, the case of "add a CRL but not use it verification" is far less common then "add a CRL and use it verification". So I would incline to keep it as is.

from lua-resty-openssl.

catbro666 avatar catbro666 commented on August 29, 2024

@fffonion Agree with high-level API should be easy to use and good by default. Setting this flag by default does make sense, but at least we should leave the possibility for the end user to not set it. The flag is not so easy to be unset, so what could have been done with one store now has to be done with two stores. OpenSSL doesn't provide direct wrapping API for unsetting flags on X509_STORE_CTX level, but does have X509_VERIFY_PARAM_clear_flags. Maybe we can extend store:verify with a clear_flags parameter to support this.

from lua-resty-openssl.

catbro666 avatar catbro666 commented on August 29, 2024

I get a more compelling reason now. There may be several independent CAs in the store and each CA can have its own CRL. If we add the crl of ca1 into the store, and the api automatically set the flag to the store. Then when we verify the client cert issued by ca2, it will fail with "unable to get certificate CRL"

from lua-resty-openssl.

fffonion avatar fffonion commented on August 29, 2024

In that case you shoudn't be adding the CRL of ca1 in the first place: only add what you intend to be verify upon later.

from lua-resty-openssl.

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.