How can I reload or update a new CA.pem file into the existing SSL CTX avoiding X509_STORE_add_cert:cert already in hash table exception

让人想犯罪 __ 提交于 2020-01-25 06:42:07

问题


I have an established SSL connection. My context is loaded with trustchain.pem file which contains all the CA info. During runtime, I am adding a new CA.pem When this addition is made the existing rustchain.pem is reloaded and the new file is taken into its list. Now if I add the new trustchain.pem file into the SSL_CTX using SSL API SSL_CTX_load_verify_locations(ctx,CAFile,CAPath) I receive:

Error Exception occurred message is error:0B07C065:x509 certificate routines:X509_STORE_add_cert:cert already in hash table

and the existing connections are terminated.

How can I do this update without duplication? Usually what happens if same .PEM file with CA list is loaded more than once using SSL_CTX_load_verify_locations()

来源:https://stackoverflow.com/questions/59552791/how-can-i-reload-or-update-a-new-ca-pem-file-into-the-existing-ssl-ctx-avoiding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!