Git Product home page Git Product logo

Comments (3)

easycoderwei avatar easycoderwei commented on May 28, 2024 1

BabaSSL实现TLCP协议时,提供了单独的双证书加载API,而不是在原生的SSL_CTX_use_certificate函数做适配。这样做有什么特殊的考虑吗?

如下是BabaSSL新增的API,
SSL_CTX_use_sign_certificate
SSL_CTX_use_enc_certificate
SSL_CTX_use_sign_PrivateKey
SSL_CTX_use_enc_PrivateKey
新增API使得上层应用(例如Nginx)也要适配双证书加载的API。之前GMSSL库是在SSL_CTX_use_certificate函数调用里面做了证书X509v3 Key Usage的判断,这样Nginx可以不用改动代码集成TLCP功能。

猜测BabaSSL这样处理的原因是为了兼容国密单证书草案。BabaSSL提供了3个新增槽位用来加载国密证书。一个提供国密单证书草案使用,另外两个提供给国密双证书。
考虑一种场景:Nginx的server同时配置了 国密单证书 和 国密双证书
如果使用原生的SSL_CTX_use_certificate函数做适配时,无法明确单证书和双证书需要加载到那个槽位。

from tongsuo.

Neo-ZK avatar Neo-ZK commented on May 28, 2024 1

猜测BabaSSL这样处理的原因是为了兼容国密单证书草案。BabaSSL提供了3个新增槽位用来加载国密证书。一个提供国密单证书草案使用,另外两个提供给国密双证书。
考虑一种场景:Nginx的server同时配置了 国密单证书 和 国密双证书
如果使用原生的SSL_CTX_use_certificate函数做适配时,无法明确单证书和双证书需要加载到那个槽位。

是的,这就最核心的原因,保证证书间的区分度,方便debug以及做兼容性方案

from tongsuo.

tangxiao187 avatar tangxiao187 commented on May 28, 2024

明白了,多谢解答。

from tongsuo.

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.